@package/data-transform
Advanced tools
Comparing version 0.0.18 to 0.0.19
@@ -58,3 +58,9 @@ "use strict"; | ||
properties = Object.keys(properties).map(id => { | ||
let property = merge({}, properties[id]); | ||
let property = properties[id]; | ||
if (!property || typeof property !== 'object') { | ||
return null; | ||
} | ||
property = merge({}, properties[id]); | ||
property.id = id; | ||
@@ -116,3 +122,3 @@ | ||
return new DataTransform({ properties: properties }); | ||
return new DataTransform({ properties: properties.filter(item => item) }); | ||
} | ||
@@ -119,0 +125,0 @@ |
{ | ||
"name" : "@package/data-transform", | ||
"version" : "0.0.18", | ||
"version" : "0.0.19", | ||
"description" : "transform a dataset into a different format", | ||
@@ -5,0 +5,0 @@ "main" : "./index.js", |
@@ -1,38 +0,1 @@ | ||
{ | ||
"from": "object", | ||
"to": "array", | ||
"properties": [ | ||
{ "id": "0", "cite": "foo", "type": "string", "ignoreCase": true, "enum": [ "bar", "bag" ] }, | ||
{ "id": "1", "cite": "bam.boom.bap", "type": "integer" }, | ||
{ | ||
"id": "3", | ||
"cite": "date", | ||
"default": "2015-02-01T00:00:00.000Z", | ||
"type": "date", | ||
"format": "YYYY-MM-DD", | ||
"min": "2015-01-01T00:00:00.000Z", | ||
"max": "2016-01-01T00:00:00.000Z" | ||
}, | ||
{ | ||
"id": "4", | ||
"cite": "whoa", | ||
"type": "array", | ||
"transform": { | ||
"from": "object", | ||
"to": "object", | ||
"properties": [ { "id": "issue", "cite": "issue", "type": "number" } ] | ||
} | ||
}, | ||
{ | ||
"id": "5", | ||
"cite": "boom", | ||
"type": "object", | ||
"transform": { | ||
"from": "object", | ||
"to": "object", | ||
"properties": [ { "id": "issue", "cite": "issue", "type": "integer" } ] | ||
} | ||
}, | ||
{ "id": "2", "cite": "2", "type": "number", "derive": "return item[1] * 2 + Math.random();\n }" } | ||
] | ||
} | ||
{"from":"object","to":"array","properties":[{"id":"0","cite":"foo","type":"string","ignoreCase":true,"enum":["bar","bag"]},{"id":"1","cite":"bam.boom.bap","type":"integer"},{"id":"3","cite":"date","default":"2015-02-01T00:00:00.000Z","type":"date","format":"YYYY-MM-DD","min":"2015-01-01T00:00:00.000Z","max":"2016-01-01T00:00:00.000Z"},{"id":"4","cite":"whoa","type":"array","transform":{"from":"object","to":"object","properties":[{"id":"issue","cite":"issue","type":"number"}]}},{"id":"5","cite":"boom","type":"object","transform":{"from":"object","to":"object","properties":[{"id":"issue","cite":"issue","type":"integer"}]}},{"id":"2","cite":"2","type":"number","derive":"return item[1] * 2 + Math.random();\n }"}]} |
33190
828