882aa08424
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 |
||
---|---|---|
src | ||
test | ||
.eslintrc.js | ||
.gitignore | ||
.npmignore | ||
package.json | ||
readme.md |
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')
}