diff --git a/source/index.ts b/source/index.ts index 71a4a32..3d96809 100644 --- a/source/index.ts +++ b/source/index.ts @@ -93,10 +93,12 @@ function isPrimitiveTypeName(name: unknown): name is PrimitiveTypeName { export type TypeName = ObjectTypeName | PrimitiveTypeName; -const {toString} = Object.prototype; // eslint-disable-next-line @typescript-eslint/ban-types -const isOfType = (type: string) => (value: unknown): value is T => typeof value === type; +function isOfType(type: PrimitiveTypeName | 'function') { + return (value: unknown): value is T => typeof value === type; +} +const {toString} = Object.prototype; const getObjectType = (value: unknown): ObjectTypeName | undefined => { const objectName = toString.call(value).slice(8, -1); if (objectName) {