0.0.2 • Published 5 years ago

@dot-event/type v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

@dot-event/type

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