Skip to content

Commit 4a6a9a5

Browse files
authored
chore(mobx-state-tree): Refactor isPrimitive fn (#1801 by @rluvaton)
[skip ci]
1 parent f3ed574 commit 4a6a9a5

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

packages/mobx-state-tree/src/utils.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -153,15 +153,14 @@ export function isMutable(value: any) {
153153
* @hidden
154154
*/
155155
export function isPrimitive(value: any, includeDate = true): value is Primitives {
156-
if (value === null || value === undefined) return true
157-
if (
156+
return (
157+
value === null ||
158+
value === undefined ||
158159
typeof value === "string" ||
159160
typeof value === "number" ||
160161
typeof value === "boolean" ||
161162
(includeDate && value instanceof Date)
162163
)
163-
return true
164-
return false
165164
}
166165

167166
/**

0 commit comments

Comments
 (0)