Package Exports
- @tiaanduplessis/type
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tiaanduplessis/type) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@tiaanduplessis/type
Basic type checking
Table of Contents
Install
This project uses node and npm.
$ npm install @tiaanduplessis/type
$ # OR
$ yarn add @tiaanduplessis/typeUsage
import * as type from '@tiaanduplessis/type'
type.isArr([]) // true
type.isArr(new Array(10)) // true
type.isBool(true) // true
type.isBool(false) // true
type.isBool(new Boolean()) // true
type.isDate(new Date()) // true
type.isEmpty([]) // true
type.isEmpty('') // true
type.isEmpty({}) // true
type.isErr(new Error('Error')) // true
type.isJSON('{"foo": true}') // true
type.isFunc(() => {}) // true
type.isFunc(function noop() {}) // true
type.isStr('')
type.isStr('true')
type.isUndef(undefined) // true
type.isSym(Symbol('test')) // true
type.isObj({}) // true
type.isObj({foo: true}) // true
type.isProm(Promise.resolve({})) // true
type.isProm(new Promise(() => {})) // true
type.isNull(null) // trueContribute
- Fork it and create your feature branch: git checkout -b my-new-feature
- Commit your changes: git commit -am 'Add some feature'
- Push to the branch: git push origin my-new-feature
- Submit a pull request
License
MIT