JSPM

@beancommons/utils

0.1.14
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q28966F
  • License MIT

js common utils

Package Exports

  • @beancommons/utils

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 (@beancommons/utils) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@beancommons/utils

Common js libs.

Install

npm install --save @beancommons/utils

Usage

import { isArray, isEmpty, isBlank } from '@beancommons/utils';

isEmpty(null);          // true
isEmpty(NaN);           // true
isEmpty({});            // true
isEmpty([]);            // true
isEmpty('  ');          // false
isBlank('  ');          // true
isArray({})             // false

API

// checks if object is Array type.
export function isArray(obj) 
// checks if object is String type.
export function isString(obj) 
// checks if object is Data type.
export function isDate(obj) 
// checks if object is Object type.
export function isObject(obj) 
// checks if object is Number type.
export function isNumber(obj) 
// checks if object is FormData type.
export function isFormData(obj)
// checks if browser is IE.
export function isIE()
// checks if object is empty, includes null, undefined, NaN, '', [] and {}, excludes '  ', [1, 2, 3], {name: 'bean'} etc.
export function isEmpty(obj) 
// checks if object is not empty.
export function isNotEmpty(obj) 
// checks if string is blank, include all of isEmpty() and '   '.
export function isBlank(str) 
// checks if string is not blank.
export function isNotBlank(obj)