New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

nullpo

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nullpo

Remove falsey values from array and object

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

nullpo

Remove falsey values from array and object

npm: nullpo CircleCI Coverage Status XO code style License: MIT code style: prettier TypeScript

Install

yarn add [-D] nullpo

Usage

import nullpo from 'nullpo';

nullpo(['foo', null, '', 123, false, () => {}]);
// [ 'foo', 123, [Function] ]

nullpo({
  foo: 'foo',
  null: null,
  empty: '',
  number: 123,
  boolean: false,
  function() {}
});
// {
//   foo: 'foo',
//   number: 123,
//   function: [Function: function]
// }


nullpo('foo');  // 'foo'
nullpo(123);  // 123

API

export type NullpoArray = any[];
export type NullpoObject = {[k: string]: any};

declare function nullpo(args: NullpoArray): NullpoArray;
declare function nullpo(args: NullpoObject): NullpoObject;
declare function nullpo(args: any): any;

Lisence

The MIT License (MIT)

Copyright (c) 2017 nju33 nju33.ki@gmail.com

Keywords

compact

FAQs

Package last updated on 09 Mar 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts