Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pauldambra committed Oct 27, 2023
1 parent 1596400 commit 564f60d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/utils/type-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@
const nativeIsArray = Array.isArray
const ObjProto = Object.prototype
export const hasOwnProperty = ObjProto.hasOwnProperty
const toString = Object.prototype.toString

export const _isArray =
nativeIsArray ||
function (obj: any): obj is any[] {
return toString.call(obj) === '[object Array]'
}
export const _isUint8Array = function (x: unknown): x is Uint8Array {
return Object.prototype.toString.call(x) === '[object Uint8Array]'
return toString.call(x) === '[object Uint8Array]'
}
// from a comment on http://dbj.org/dbj/?p=286
// fails on only one very rare and deliberate custom object:
Expand Down Expand Up @@ -43,7 +44,7 @@ export const _isUndefined = function (x: unknown): x is undefined {
}
export const _isString = function (x: unknown): x is string {
// eslint-disable-next-line posthog-js/no-direct-string-check
return Object.prototype.toString.call(x) == '[object String]'
return toString.call(x) == '[object String]'
}
export const _isNull = function (x: unknown): x is null {
// eslint-disable-next-line posthog-js/no-direct-null-check
Expand Down

0 comments on commit 564f60d

Please sign in to comment.