Skip to content

Commit 41c3a7b

Browse files
Merge pull request #14 from hcengineering/fix-type-of
Fix exception in getTypeOf
2 parents ba1c2ac + dfcc6d1 commit 41c3a7b

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919
- uses: actions/setup-node@v3
2020
with:
2121
node-version: 22
22-
- name: Verify Change Logs
23-
run: node common/scripts/install-run-rush.js change --verify
2422
- name: Rush Install
2523
run: node common/scripts/install-run-rush.js install
2624
- name: Rush check

packages/core/src/clone.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ export function getTypeOf (obj: any): string {
3838
if (objPrototype === null) {
3939
return 'Object'
4040
}
41-
return {}.toString.call(obj).slice(8, -1)
41+
try {
42+
return {}.toString.call(obj).slice(8, -1)
43+
} catch {
44+
return 'Object'
45+
}
4246
}
4347

4448
export function clone (

0 commit comments

Comments
 (0)