1.0.2 • Published 2 years ago

utility-is v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

utility-is

Utils for javascript

Install

pnpm add utility-is

Usage

import u from 'utility-is'

u('❤️');
// => string

u.isString('❤️')
// => true

u.isNonNullable(null)
// => false

Api

u(value)

return the type of value

Example:

  • 'string'
  • 'number'
  • 'boolean'
  • 'array'
  • 'object'
  • 'symbol'
  • 'map'
  • 'set'

u.isXXX

like:

isNumber(value)
isArray(value)
isPromise(value)
isAsyncFunction(value)

return false if there is no await statement in the function

And More...
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago