Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
object-delete-key
Advanced tools
Delete keys from all arrays or plain objects, nested within anything, by key or by value or by both, and clean up afterwards. Accepts wildcards.
Delete keys from all arrays or plain objects, nested within anything, by key or by value or by both, and clean up afterwards. Accepts wildcards.
This package is pure ESM. If you're not ready yet, install an older version of this program, 2.1.0 (npm i object-delete-key@2.1.0
).
npm i object-delete-key
import { strict as assert } from "assert";
import { deleteKey } from "object-delete-key";
// deleting key 'c', with value 'd'
assert.deepEqual(
deleteKey(
{
a: "b",
c: "d",
},
{
key: "c",
val: "d",
},
),
{ a: "b" },
);
// deleting key 'b' with value - array ['c', 'd']
assert.deepEqual(
deleteKey(
{
a: { e: [{ b: ["c", "d"] }] },
b: ["c", "d"],
},
{
key: "b",
val: ["c", "d"],
},
),
{},
);
// notice program cleaned after itself, it didn't leave empty "a" key
Please visit codsen.com for a full description of the API.
To report bugs or request features or assistance, raise an issue on GitHub.
MIT License.
Copyright © 2010-2024 Roy Revelt and other contributors.
FAQs
Delete keys from all arrays or plain objects, nested within anything, by key or by value or by both, and clean up afterwards. Accepts wildcards.
The npm package object-delete-key receives a total of 195 weekly downloads. As such, object-delete-key popularity was classified as not popular.
We found that object-delete-key demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.