JamieMason/expect-more

View on GitHub
packages/expect-more/src/lib/has-type.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { getType } from './get-type';

export const hasType =
  <T>(type: string) =>
  <CallTimeType = T>(value: unknown): value is CallTimeType =>
    getType(value) === `[object ${type}]`;