Extension of the TypeChecker package
 
Go to file
David Kebler 882aa08424 0.5.1 reworked getting database path from config file to be more flexible and to override by env var
major improvements to upgrade code for v2+ deploy of 645.  Cleans with simple git if need be
uses cast, typeOf and check from utils to better set values
reworked systemd now to two unit files only
2020-04-08 11:23:17 -07:00
src 0.5.1 reworked getting database path from config file to be more flexible and to override by env var 2020-04-08 11:23:17 -07:00
test 0.5.1 reworked getting database path from config file to be more flexible and to override by env var 2020-04-08 11:23:17 -07:00
.eslintrc.js split off from uci-utils - see uci-utils for former commits 2019-02-16 12:22:04 -08:00
.gitignore 0.5.0 add type casting support and bumbed version 2020-03-16 10:37:38 -07:00
.npmignore split off from uci-utils - see uci-utils for former commits 2019-02-16 12:22:04 -08:00
package.json 0.5.1 reworked getting database path from config file to be more flexible and to override by env var 2020-04-08 11:23:17 -07:00
readme.md 0.5.1 reworked getting database path from config file to be more flexible and to override by env var 2020-04-08 11:23:17 -07:00

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')
}