
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
deprecated-obj
Advanced tools
Compares deprecations against a configuration object, and returns a compliant object and violations
Simple utility to help making the transition from deprecated configuration objects to compliant ones.
const Deprecation = require('deprecation');
const myConfig = {
fine: true,
old: {
deprecated: true
},
'remove.me': 1
};
const deprecations = {
old: {
deprecated: 'new.shiny'
},
'remove.me': null
};
// Or flat:
const deprecations = { 'old.deprecated': 'new.shiny', 'remove.me': null };
const deprecation = new Deprecation(deprecations, myConfig);
Deprecation::getCompliant()
const myCompliant = deprecation.getCompliant();
ā { fine: true, new: { shiny: true } }
Returns a new, compliant object. The null
values in deprecations
are excluded.
Deprecation::getViolations()
const violations = deprecation.getViolations();
ā { 'old.deprecated': 'new.shiny', 'remove.me': null }
The violations can be used to inform the user about the deprecations, for example:
if (Object.keys(violations).length > 0) {
console.warn(`Deprecated configuration options found. Please migrate before the next major release.`);
}
for (let deprecated in violations) {
console.warn(`The "${deprecated}" option is deprecated. Please use "${violations[deprecated]}" instead.`);
}
See github.com/release-it/.../deprecated.js for a real-world example.
FAQs
Compares deprecations against a configuration object, and returns a compliant object and violations
The npm package deprecated-obj receives a total of 59,993 weekly downloads. As such, deprecated-obj popularity was classified as popular.
We found that deprecated-obj 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
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.