File tree Expand file tree Collapse file tree 5 files changed +7
-13
lines changed Expand file tree Collapse file tree 5 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ export function createReducer<S extends NotFunction<any>>(
253
253
const draft = previousState as Draft < S > // We can assume this is already a draft
254
254
const result = caseReducer ( draft , action )
255
255
256
- if ( typeof result === ' undefined' ) {
256
+ if ( result === undefined ) {
257
257
return previousState
258
258
}
259
259
@@ -263,7 +263,7 @@ export function createReducer<S extends NotFunction<any>>(
263
263
// return the caseReducer func and not wrap it with produce.
264
264
const result = caseReducer ( previousState as any , action )
265
265
266
- if ( typeof result === ' undefined' ) {
266
+ if ( result === undefined ) {
267
267
if ( previousState === null ) {
268
268
return previousState
269
269
}
Original file line number Diff line number Diff line change @@ -67,12 +67,7 @@ function getSerialize(
67
67
* @public
68
68
*/
69
69
export function isImmutableDefault ( value : unknown ) : boolean {
70
- return (
71
- typeof value !== 'object' ||
72
- value === null ||
73
- typeof value === 'undefined' ||
74
- Object . isFrozen ( value )
75
- )
70
+ return typeof value !== 'object' || value == null || Object . isFrozen ( value )
76
71
}
77
72
78
73
export function trackForMutations (
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ function stripUndefined(obj: any) {
104
104
}
105
105
const copy : Record < string , any > = { ...obj }
106
106
for ( const [ k , v ] of Object . entries ( copy ) ) {
107
- if ( typeof v === ' undefined' ) delete copy [ k ]
107
+ if ( v === undefined ) delete copy [ k ]
108
108
}
109
109
return copy
110
110
}
Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ import type { BaseQueryFn } from '../baseQueryTypes'
58
58
// Copy-pasted from React-Redux
59
59
export const useIsomorphicLayoutEffect =
60
60
typeof window !== 'undefined' &&
61
- typeof window . document !== 'undefined' &&
62
- typeof window . document . createElement !== 'undefined'
61
+ window . document &&
62
+ window . document . createElement
63
63
? useLayoutEffect
64
64
: useEffect
65
65
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ import { getTimeMeasureUtils } from './utils'
14
14
export function isPlain ( val : any ) {
15
15
const type = typeof val
16
16
return (
17
- type === 'undefined' ||
18
- val === null ||
17
+ val == null ||
19
18
type === 'string' ||
20
19
type === 'boolean' ||
21
20
type === 'number' ||
You can’t perform that action at this time.
0 commit comments