0.0.2 • Published 5 years ago
@dot-event/type v0.0.2
@dot-event/type
Install
npm install @dot-event/type
Setup
var dot = require("dot-event")()
require("@dot-event/type")(dot)
Usage
expect(dot.type({ arg: "" })).toBe("string")
expect(
dot.typeCheck({ check: "", type: "string" })
).toBeTruthy()
expect(
dot.typeCheck({ check: true, type: "any" })
).toBeTruthy()
expect(
dot.typeCheck({ check: true, type: "boolean | string" })
).toBeTruthy()
Valid types
- array
- boolean
- date
- error
- function
- null
- number
- object
- promise
- regexp
- string
- symbol