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>>(
253253 const draft = previousState as Draft < S > // We can assume this is already a draft
254254 const result = caseReducer ( draft , action )
255255
256- if ( typeof result === ' undefined' ) {
256+ if ( result === undefined ) {
257257 return previousState
258258 }
259259
@@ -263,7 +263,7 @@ export function createReducer<S extends NotFunction<any>>(
263263 // return the caseReducer func and not wrap it with produce.
264264 const result = caseReducer ( previousState as any , action )
265265
266- if ( typeof result === ' undefined' ) {
266+ if ( result === undefined ) {
267267 if ( previousState === null ) {
268268 return previousState
269269 }
Original file line number Diff line number Diff line change @@ -67,12 +67,7 @@ function getSerialize(
6767 * @public
6868 */
6969export 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 )
7671}
7772
7873export function trackForMutations (
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ function stripUndefined(obj: any) {
104104 }
105105 const copy : Record < string , any > = { ...obj }
106106 for ( const [ k , v ] of Object . entries ( copy ) ) {
107- if ( typeof v === ' undefined' ) delete copy [ k ]
107+ if ( v === undefined ) delete copy [ k ]
108108 }
109109 return copy
110110}
Original file line number Diff line number Diff line change @@ -58,8 +58,8 @@ import type { BaseQueryFn } from '../baseQueryTypes'
5858// Copy-pasted from React-Redux
5959export const useIsomorphicLayoutEffect =
6060 typeof window !== 'undefined' &&
61- typeof window . document !== 'undefined' &&
62- typeof window . document . createElement !== 'undefined'
61+ window . document &&
62+ window . document . createElement
6363 ? useLayoutEffect
6464 : useEffect
6565
Original file line number Diff line number Diff line change @@ -14,8 +14,7 @@ import { getTimeMeasureUtils } from './utils'
1414export function isPlain ( val : any ) {
1515 const type = typeof val
1616 return (
17- type === 'undefined' ||
18- val === null ||
17+ val == null ||
1918 type === 'string' ||
2019 type === 'boolean' ||
2120 type === 'number' ||
You can’t perform that action at this time.
0 commit comments