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

0.4.3 • Public • Published

truthy-strings-keys

NPM version npm license Travis Build Status Dependency Status

npm

Resolves a simple string or a potentially deeply nested structure of primitive values into a simple string array.

Installation

$ npm install truthy-strings-keys

Usage

truthyStringsKeys( deepArray [, options] )

const deepArray = [
  'foo', [
    {
      bar: true,
      baz: null,
    },
  ],
  'foo',
  'qux',
  [
    [
      [
        {
          corge: undefined,
          garpley: -1,
        },
      ],
    ],
  ],
];
 
truthyStringsKeys(deepArray);
// ["foo", "bar", "foo", "qux", "garpley"]
 
truthyStringsKeys(deepArray, { unique: true });
// ["foo", "bar", "qux", "garpley"]

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.

Package Sidebar

Install

npm i truthy-strings-keys

Weekly Downloads

1

Version

0.4.3

License

MIT

Last publish

Collaborators

  • jedmao