Comparing version 2.3.2 to 2.3.3
@@ -14,3 +14,3 @@ "use strict"; | ||
var node; | ||
for (var i in nodes) { | ||
for (var i = 0; i < nodes.length; i++) { | ||
node = nodes[i]; | ||
@@ -137,3 +137,2 @@ switch (node.type) { | ||
function deepRef(start, keys, value, line, column) { | ||
var key; | ||
var traversed = []; | ||
@@ -143,10 +142,9 @@ var traversedPath = ""; | ||
var ctx = start; | ||
var keysLen = keys.length; | ||
for (var i in keys) { | ||
key = keys[i]; | ||
for (var i = 0; i < keys.length; i++) { | ||
var key = keys[i]; | ||
traversed.push(key); | ||
traversedPath = traversed.join("."); | ||
if (typeof ctx[key] === "undefined") { | ||
if (i === String(keysLen - 1)) { | ||
if (i === keys.length - 1) { | ||
ctx[key] = value; | ||
@@ -156,3 +154,3 @@ } else { | ||
} | ||
} else if (i !== keysLen - 1 && valueAssignments.indexOf(traversedPath) > -1) { | ||
} else if (i !== keys.length - 1 && valueAssignments.indexOf(traversedPath) > -1) { | ||
// already a non-object value at key, can't be used as part of a new path | ||
@@ -174,3 +172,3 @@ genError("Cannot redefine existing key '" + traversedPath + "'.", line, column); | ||
var firstType = null; | ||
for(var i in array) { | ||
for (var i = 0; i < array.length; i++) { | ||
var node = array[i]; | ||
@@ -177,0 +175,0 @@ if (firstType === null) { |
{ | ||
"name": "toml", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "TOML parser for Node.js (parses TOML spec v0.4.0)", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -75,2 +75,6 @@ var toml = require('../'); | ||
{ | ||
"name": "durian", | ||
"variety": [] | ||
}, | ||
{ | ||
"name": "apple", | ||
@@ -77,0 +81,0 @@ "physical": { |
Sorry, the diff of this file is not supported yet
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
143667
4239