truthy-keys
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

truthy-keys

NPM version npm license Travis Build Status Dependency Status

npm

Creates an array of the own enumerable property names of an object for which the values are truthy.

Installation

$ npm install truthy-keys

Usage examples

truthyKeys({ foo: true, bar: false });
// ["foo"]
 
truthyKeys('foo');
// ["0", "1", "2"]
 
truthyKeys(/* any falsey value */);
// []
 
truthyKeys(42);
// []

See the tests.

Testing

Run the following command:

$ npm test

This will build scripts, run tests and generate a code coverage report. Anything less than 100% coverage will throw an error.

Watching

For much faster development cycles, run the following commands in 2 separate processes:

$ npm run build:watch

Compiles TypeScript source into the ./dist folder and watches for changes.

$ npm run watch

Runs the tests in the ./dist folder and watches for changes.

Readme

Keywords

Package Sidebar

Install

npm i truthy-keys

Weekly Downloads

1

Version

0.1.3

License

MIT

Last publish

Collaborators

  • jedmao