@emit-js/type

0.0.4 • Public • Published

@emit-js/type

emit type checking

type

Install

npm install @emit-js/type

Setup

var emit = require("@emit-js/emit")()
require("@emit-js/type")(emit)

Usage

expect(emit.type("")).toBe("string")

expect(
  emit.typeCheck({ check: "", type: "string" })
).toBeTruthy()

expect(
  emit.typeCheck({ check: true, type: "any" })
).toBeTruthy()

expect(
  emit.typeCheck({ check: true, type: "boolean | string" })
).toBeTruthy()

Valid types

  • array
  • boolean
  • date
  • error
  • function
  • null
  • number
  • object
  • promise
  • regexp
  • string
  • symbol

Readme

Keywords

Package Sidebar

Install

npm i @emit-js/type

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

10.1 kB

Total Files

5

Last publish

Collaborators

  • winton