utility-is
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

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...

Package Sidebar

Install

npm i utility-is

Weekly Downloads

2

Version

1.0.2

License

MIT

Unpacked Size

11.7 kB

Total Files

4

Last publish

Collaborators

  • yellowryan