Socket
Socket
Sign inDemoInstall

webidl2js

Package Overview
Dependencies
Maintainers
1
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webidl2js - npm Package Compare versions

Comparing version 4.0.2 to 4.1.0

20

lib/parameters.js

@@ -13,2 +13,9 @@ "use strict";

if (idlType.nullable) {
str += `
if (${name} === null || ${name} === undefined) {
${name} = null;
} else {`;
}
if (conversions[idlType.idlType] || customTypes.has(idlType.idlType)) {

@@ -27,9 +34,2 @@ const enforceRange = utils.getExtAttr(argAttrs, "EnforceRange");

}
if (idlType.nullable) {
str += `
if (${name} === null || ${name} === undefined) {
${name} = null;
} else {`;
}
let conversionFn = null;

@@ -59,7 +59,7 @@ if (conversions[idlType.idlType]) {

}
}
if (idlType.nullable) {
str += `
if (idlType.nullable) {
str += `
}`;
}
}

@@ -66,0 +66,0 @@

@@ -26,12 +26,21 @@ "use strict";

["long", "unsigned long"].forEach((key) => {
module.exports[key] = {
get(objName, attrName) {
return `const value = this.getAttribute("${attrName}");
return value === null ? "" : String(value);`;
},
set(objName, attrName) {
return `this.setAttribute("${attrName}", String(V));`;
}
};
});
module.exports["long"] = {
get(objName, attrName) {
return `const value = parseInt(this.getAttribute("${attrName}"));
return isNaN(value) || value < -2147483648 || value > 2147483647 ? 0 : value`;
},
set(objName, attrName) {
return `this.setAttribute("${attrName}", String(V));`;
}
};
module.exports["unsigned long"] = {
get(objName, attrName) {
return `const value = parseInt(this.getAttribute("${attrName}"));
return isNaN(value) || value < 0 || value > 2147483647 ? 0 : value`;
},
set(objName, attrName) {
return `V = V > 2147483647 ? 0 : V;
this.setAttribute("${attrName}", String(V));`;
}
};
{
"name": "webidl2js",
"version": "4.0.2",
"version": "4.1.0",
"description": "Auto-generates class structures for WebIDL specifications",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc