Socket
Book a DemoInstallSign in
Socket

clearkeys

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

clearkeys

clear keys for object and its child nodes

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

clearkeys

clear keys for object and its child nodes

Install

for node

$ npm install clearkeys --save

for browser

$ cortex install clearkeys --save

Usage

var origin = {
  "a": 1,
  "b": [],
  "c": [],
  "d": {}
};
origin.c.push({"b":origin,"d":2});
origin.c.push({"b":origin,"d":3});
origin.d.b = origin;
origin.d.e = 4;
var obj = clearkeys(origin, ["a","b"]);
// now obj will be {"c":[{"d":2},{"d":3}],"d":{"e":4}}

Todo

  • able to custom filters, for example, to clear keys whose value is a function.

Keywords

clearkeys

FAQs

Package last updated on 12 Jul 2014

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