Skip to content

JohnyDays/type-checking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Type Checking

Check for what you need

Mainly for framework developers, although it is just as usable in an app

Installation

npm install --save type-checking

Usage

  • By registering (recommended, but can cause conflicts)
  require('type-checking/register')('responds_to')

  array = []

  array.responds_to 'indexOf' #true
  array.responds_to ['indexOf','join','concat'] #true

  class ArrayInterface
    indexOf:->
    join:->
    concat:->

  array.responds_to ArrayInterface #true
  • Directly
  responds_to = require 'type-checking'

  array = []

  responds_to array, 'indexOf' #true

About

Check for what you need

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published