@emit-js/type
v0.0.4
Published
emit type checker
Downloads
1
Readme
@emit-js/type
emit type checking
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