@nodecraft/ini
Advanced tools
Comparing version 2.2.0 to 2.2.1
12
ini.js
@@ -7,2 +7,6 @@ 'use strict'; | ||
function isConstructorOrProto(obj, key){ | ||
return key === 'constructor' && typeof obj[key] === 'function' || key === '__proto__'; | ||
} | ||
const encode = (obj, options) => { | ||
@@ -86,3 +90,3 @@ const children = []; | ||
section = unsafe(match[1]); | ||
if(section === '__proto__'){ | ||
if(isConstructorOrProto(out, section)){ | ||
// not allowed | ||
@@ -97,3 +101,3 @@ // keep parsing the section, but don't attach it. | ||
let key = unsafe(match[2]); | ||
if(key === '__proto__'){ continue; } | ||
if(isConstructorOrProto(ref, key)){ continue; } | ||
let value = match[3] ? unsafe(match[3]) : defaultValue; | ||
@@ -113,3 +117,3 @@ switch(value){ | ||
key = key.slice(0, Math.max(0, key.length - 2)); | ||
if(key === '__proto__'){ continue; } | ||
if(isConstructorOrProto(ref, key)){ continue; } | ||
if(!hasOwnProperty.call(ref, key)){ | ||
@@ -147,3 +151,3 @@ ref[key] = []; | ||
for(const part of parts){ | ||
if(part === '__proto__'){ continue; } | ||
if(isConstructorOrProto(outPart, part)){ continue; } | ||
if(!hasOwnProperty.call(outPart, part) || typeof outPart[part] !== 'object'){ | ||
@@ -150,0 +154,0 @@ outPart[part] = Object.create(null); |
{ | ||
"name": "@nodecraft/ini", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "An ini encoder/decoder for node", | ||
@@ -24,13 +24,13 @@ "repository": { | ||
"devDependencies": { | ||
"@nodecraft/eslint-config": "^9.0.0", | ||
"eslint": "^7.30.0", | ||
"eslint-plugin-json": "^3.0.0", | ||
"@nodecraft/eslint-config": "^16.0.0", | ||
"eslint": "^8.12.0", | ||
"eslint-plugin-json": "^3.1.0", | ||
"eslint-plugin-node": "^11.1.0", | ||
"eslint-plugin-unicorn": "^34.0.1", | ||
"tap": "^15" | ||
"eslint-plugin-unicorn": "^41.0.1", | ||
"tap": "^16" | ||
}, | ||
"engines": { | ||
"node": ">=12.20.0", | ||
"npm": ">=6.14.9" | ||
"node": ">=16", | ||
"npm": ">=8" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13001
215