Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// svg: compatData.svg,
// webdriver: compatData.webdriver,
// webextensions: compatData.webextensions
// }
const payload = {
api: compatData.api,
browsers: compatData.browsers,
css: compatData.css,
html: compatData.html,
http: compatData.http,
javascript: compatData.javascript,
mathml: compatData.mathml,
svg: compatData.svg,
webdriver: compatData.webdriver,
webextensions: compatData.webextensions
}
fs.writeFile(
path.resolve(
__dirname,
'..',
'public',
'data.json'
),
JSON.stringify(payload, null, 2),
err => {
if (err) {
console.error(err)
}
}
)
) {
if (this.isDictionary) {
// Dictionaries should not have a strict_max_version at all.
this.isValid = false;
this.collector.addError(messages.STRICT_MAX_VERSION);
} else {
// Rest of the extensions can, even though it's not recommended.
this.collector.addNotice(messages.STRICT_MAX_VERSION);
}
}
const minVersion = firefoxStrictMinVersion(this.parsedJSON);
if (!this.isLanguagePack && !this.isDictionary && minVersion) {
for (const key in bcd.webextensions.manifest) {
if (Object.prototype.hasOwnProperty.call(this.parsedJSON, key)) {
const compatInfo = bcd.webextensions.manifest[key];
this.checkCompatInfo(
compatInfo,
minVersion,
key,
this.parsedJSON[key]
);
}
}
}
if (isToolkitVersionString(this.parsedJSON.version)) {
this.collector.addNotice(messages.PROP_VERSION_TOOLKIT_ONLY);
}
if (this.parsedJSON.default_locale) {
const msg = path.join(
this.parsedJSON.applications.gecko &&
this.parsedJSON.applications.gecko.strict_max_version
) {
if (this.isDictionary) {
// Dictionaries should not have a strict_max_version at all.
this.isValid = false;
this.collector.addError(messages.STRICT_MAX_VERSION);
} else {
// Rest of the extensions can, even though it's not recommended.
this.collector.addNotice(messages.STRICT_MAX_VERSION);
}
}
const minVersion = firefoxStrictMinVersion(this.parsedJSON);
if (!this.isLanguagePack && !this.isDictionary && minVersion) {
for (const key in bcd.webextensions.manifest) {
if (Object.prototype.hasOwnProperty.call(this.parsedJSON, key)) {
const compatInfo = bcd.webextensions.manifest[key];
this.checkCompatInfo(
compatInfo,
minVersion,
key,
this.parsedJSON[key]
);
}
}
}
if (isToolkitVersionString(this.parsedJSON.version)) {
this.collector.addNotice(messages.PROP_VERSION_TOOLKIT_ONLY);
}