JSPM

trim-null

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q15125F
  • License ISC

去除对象中值为null的项

Package Exports

  • trim-null

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

Readme

trim-null

null is unfriendly to destructuring assignment in Javascript, use trim-null to delete the entry which value is null in an object or transform to undefined if in an array.

install

$ yarn add trim-null

or

$ npm install trim-null

usage

import trimNull from 'trim-null';

trimNull([null, {a: null}]) // [undefined, {}]