Extension of the TypeChecker package
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
Kebler Network System Administrator b5d6f5a995 0.6.4 1 year ago
src 0.6.4 1 year ago
test 0.6.4 1 year ago
.eslintrc.js split off from uci-utils - see uci-utils for former commits 4 years ago
.gitignore 0.5.0 add type casting support and bumbed version 2 years ago
.npmignore split off from uci-utils - see uci-utils for former commits 4 years ago
package.json 0.6.4 1 year ago
readme.md 0.5.1 reworked getting database path from config file to be more flexible and to override by env var 2 years ago

readme.md

uCOMmandIt Type Library

Extends the type checker Library All includes some simple type casting including using uci to-boolean for boolean type casting.

See type checker api http://master.typechecker.bevry.surge.sh/docs/

extensions are

.isPromise .isBuffer

TODO add

import isObservable from 'is-observable' import isPromise from 'p-is-promise'

function isEmitter(emitter) {
  if (!emitter) return false
  let check = ['on','emit']
  return check.reduce((acc,fn)=> acc && typeof emitter[fn] ==='function',true)
}

function isAsync(fn) {
  if (typeof fn !== 'function') return false
  return (isPromise(fn) || fn.constructor.name === 'AsyncFunction')
}