Skip to content

Commit

Permalink
toString type
Browse files Browse the repository at this point in the history
  • Loading branch information
planttheidea committed Jul 9, 2019
1 parent df12af9 commit 4500f89
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ const { create, getOwnPropertySymbols, getPrototypeOf, keys, propertyIsEnumerabl

const { isArray } = Array;

const toStringFunction = Function.prototype.bind.call(
type ToString = (value: any) => string;

const toStringFunction: ToString = Function.prototype.bind.call(
Function.prototype.call,
Function.prototype.toString,
);
const toStringObject = Function.prototype.bind.call(Function.prototype.call, O.prototype.toString);
const toStringObject: ToString = Function.prototype.bind.call(
Function.prototype.call,
O.prototype.toString,
);

/**
* @constant HAS_SYMBOL_SUPPORT are Symbols supported
Expand Down Expand Up @@ -159,7 +164,7 @@ export const isCloneable = (object: any) => {
return false;
}

const type: string = toStringObject(object);
const type = toStringObject(object);

return type !== '[object Date]' && type !== '[object RegExp]';
};
Expand Down

0 comments on commit 4500f89

Please sign in to comment.