diff --git a/.changeset/dirty-snakes-sip.md b/.changeset/dirty-snakes-sip.md new file mode 100644 index 000000000..a99dcf054 --- /dev/null +++ b/.changeset/dirty-snakes-sip.md @@ -0,0 +1,5 @@ +--- +'@segment/analytics-core': patch +--- + +Tighten isPlainObject type guard diff --git a/packages/browser/package.json b/packages/browser/package.json index 015645423..e7cdb42e6 100644 --- a/packages/browser/package.json +++ b/packages/browser/package.json @@ -24,7 +24,7 @@ ], "sideEffects": false, "scripts": { - ".": "yarn run -T turbo run --filter=@segment/analytics-next", + ".": "yarn run -T turbo run --filter=@segment/analytics-next...", "build-prep": "sh scripts/build-prep.sh", "version": "yarn run build-prep && git add src/generated/version.ts", "umd": "webpack", diff --git a/packages/core/src/validation/helpers.ts b/packages/core/src/validation/helpers.ts index b1d6de641..511b03a64 100644 --- a/packages/core/src/validation/helpers.ts +++ b/packages/core/src/validation/helpers.ts @@ -16,7 +16,7 @@ export function exists(val: unknown): val is NonNullable { export function isPlainObject( obj: unknown -): obj is Record { +): obj is Record { return ( Object.prototype.toString.call(obj).slice(8, -1).toLowerCase() === 'object' )