restruct-data
Advanced tools
Comparing version 0.2.8 to 0.2.9
{ | ||
"name": "restruct-data", | ||
"version": "0.2.8", | ||
"version": "0.2.9", | ||
"description": "ERROR: No README data found!", | ||
@@ -5,0 +5,0 @@ "main": "restruct.js", |
@@ -70,4 +70,2 @@ | ||
result[k] = fill(v, data); | ||
else if(typeof v === 'number') | ||
result[k] = v; | ||
else if(Array.isArray(v)) { | ||
@@ -117,6 +115,11 @@ if (typeof v[0] === 'string') | ||
restruct.prototype.extend_list = function (rows, struct, result) { | ||
for (var i in rows) { | ||
rows[i][restruct.indexKey] = parseInt(i); | ||
this.extend(rows[i], struct, result); | ||
if (rows.length === 0) { | ||
this.extend({}, struct, result); | ||
} | ||
else { | ||
for (var i in rows) { | ||
rows[i][restruct.indexKey] = parseInt(i); | ||
this.extend(rows[i], struct, result); | ||
} | ||
} | ||
return result; | ||
@@ -123,0 +126,0 @@ } |
12
tests.js
@@ -169,13 +169,1 @@ | ||
console.log(json(data,true)) | ||
/* test if restruct handles integers */ | ||
var struct = { | ||
"< test": { | ||
"integer_test": 1 | ||
} | ||
} | ||
var data = restruct({ | ||
"test": "Test", | ||
}, struct); | ||
console.log(json(data,true)) |
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
7278
276