Skip to content

Commit 6600116

Browse files
committed
De-duplicate IgnorePaths type
1 parent fab6018 commit 6600116

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

packages/toolkit/src/immutableStateInvariantMiddleware.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Middleware } from 'redux'
2+
import type { IgnorePaths } from './serializableStateInvariantMiddleware'
23
import { getTimeMeasureUtils } from './utils'
34

45
type EntryProcessor = (key: string, value: any) => any
@@ -60,8 +61,6 @@ function trackProperties(
6061
return tracked as TrackedProperty
6162
}
6263

63-
type IgnorePaths = readonly (string | RegExp)[]
64-
6564
function detectMutations(
6665
isImmutable: IsImmutableFunc,
6766
ignoredPaths: IgnorePaths = [],
@@ -135,12 +134,12 @@ export interface ImmutableStateInvariantMiddlewareOptions {
135134
/**
136135
Callback function to check if a value is considered to be immutable.
137136
This function is applied recursively to every value contained in the state.
138-
The default implementation will return true for primitive types
137+
The default implementation will return true for primitive types
139138
(like numbers, strings, booleans, null and undefined).
140139
*/
141140
isImmutable?: IsImmutableFunc
142-
/**
143-
An array of dot-separated path strings that match named nodes from
141+
/**
142+
An array of dot-separated path strings that match named nodes from
144143
the root state to ignore when checking for immutability.
145144
Defaults to undefined
146145
*/

packages/toolkit/src/serializableStateInvariantMiddleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ interface NonSerializableValue {
2828
value: unknown
2929
}
3030

31-
type IgnorePaths = readonly (string | RegExp)[]
31+
export type IgnorePaths = readonly (string | RegExp)[]
3232

3333
/**
3434
* @public

0 commit comments

Comments
 (0)