remove-if-prefix
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Remove if prefix Travis CI Build Status

Remove an item from an object or array of objects if the key starts with a specific character.

NPM Badge

Install

npm install remove-if-prefix

Usage

const removeIfPrefix = require("remove-if-prefix");

removeIfPrefix(
    {
        a: {
            _a: "a",
            b: 1
        },
        _b: ["b"]
    },
    "_"
);
//=> { a: { b: 1 } }

API

removeIfPrefix(obj, prefix)

obj

Type: object or array

The object or array to handle.

prefix

Type: string

The prefix to check for.

Readme

Keywords

Package Sidebar

Install

npm i remove-if-prefix

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

3.58 kB

Total Files

6

Last publish

Collaborators

  • richienb