Skip to content

dot-event/type

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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

About

dot-event type checking

Resources

Stars

Watchers

Forks

Packages

No packages published