![Maven Central Adds Sigstore Signature Validation](https://cdn.sanity.io/images/cgdhsj6q/production/7da3bc8a946cfb5df15d7fcf49767faedc72b483-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Remove undefined
properties from object.
N.B. Does not remove null
or falsy values, just undefined
.
$ npm install rundef
$ yarn add rundef
const rundef = require('rundef');
import rundef from 'rundef';
For the most accurate examples, see the test.js
file
const input = {
a: undefined,
b: 1
}
rundef(input); // { b: 1 }
rundef
supports two options:
mutate
boolean - if truthy, the original object will be mutated; if falsy, a new object will be constructed and returned. Defaults to false
recursive
boolean | int - whether rundef
should recursively process nested objects. If it's an integer, it will specify the number of nested layers, or levels, to process. If it is set to true
, it will recursively process all layers. Defaults to 0
, which is equivalent to false
.const input = {
a: undefined, // Level 0
b: {
c: 1,
d: undefined, // Level 1
e: {
f: undefined // Level 2
}
}
}
const output = rundef(
input,
false, // mutate - whether to mutate the original object or return a new one
1, // recursive - whether to apply recursively
);
output;
{ // Level 0
b: {
c: 1, // Level 1
e: {
f: undefined // Level 2 - Not removed as level 1 was specified
}
}
}
FAQs
Remove undefined properties from object
The npm package rundef receives a total of 0 weekly downloads. As such, rundef popularity was classified as not popular.
We found that rundef demonstrated a not healthy version release cadence and project activity because the last version was released 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.