Skip to content

Commit

Permalink
Merge efd4035 into 0e6e497
Browse files Browse the repository at this point in the history
  • Loading branch information
otonashixav committed Jun 7, 2022
2 parents 0e6e497 + efd4035 commit 6fd1f43
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/solid/store/src/server.ts
Expand Up @@ -6,7 +6,7 @@ export function isWrappable(obj: any) {
return (
obj != null &&
typeof obj === "object" &&
(obj.__proto__ === Object.prototype || Array.isArray(obj))
(Object.getPrototypeOf(obj) === Object.prototype || Array.isArray(obj))
);
}

Expand Down
6 changes: 5 additions & 1 deletion packages/solid/store/src/store.ts
Expand Up @@ -41,10 +41,14 @@ function wrap<T extends StoreNode>(value: T, name?: string): T {

export function isWrappable<T>(obj: T | NotWrappable): obj is T;
export function isWrappable(obj: any) {
let proto;
return (
obj != null &&
typeof obj === "object" &&
(obj[$PROXY] || !obj.__proto__ || obj.__proto__ === Object.prototype || Array.isArray(obj))
(obj[$PROXY] ||
!(proto = Object.getPrototypeOf(obj)) ||
proto === Object.prototype ||
Array.isArray(obj))
);
}

Expand Down

0 comments on commit 6fd1f43

Please sign in to comment.