frontend/.pnpm-store/v3/files/16/4e25d008aac13469eb2c02d4c640a3032153231678321fa21961f12af0f5cda2dd3481f9d11cdfd5e77077988cec3177f30658b0eeb593ed46844e1482dec3

21 lines
743 B
Plaintext

const Deprecated = require('deprecated-obj');
const deprecated = require('../config/deprecated.json');
const Log = require('./log');
module.exports = (config, log = new Log()) => {
const deprecations = new Deprecated(deprecated, config);
const compliant = deprecations.getCompliant();
const violations = deprecations.getViolations();
if (Object.keys(violations).length > 0) {
log.warn(`Deprecated configuration options found. Please migrate before the next major release.`);
}
for (const d in violations) {
log.warn(
`The "${d}" option is deprecated. ${
violations[d] ? (/^[A-Z]/.test(violations[d]) ? violations[d] : `Please use "${violations[d]}" instead.`) : ''
}`
);
}
return compliant;
};