@journeyapps/parser-schema
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -10,4 +10,2 @@ import { Type } from './Type'; | ||
}; | ||
cast(value: any): any[]; | ||
clone(array: any): any[]; | ||
} |
@@ -16,33 +16,4 @@ "use strict"; | ||
} | ||
cast(value) { | ||
if (typeof value != 'object') { | ||
throw new Error(value + ' is not an object'); | ||
} | ||
var thisTypeName = this.objectType.name; | ||
if (value instanceof Array) { | ||
// TODO: do we need to check the object values? | ||
return value; | ||
} | ||
else { | ||
// We do not print the value here, since it may be a massive array. | ||
throw new Error('Expected value to have array type ' + thisTypeName); | ||
} | ||
} | ||
clone(array) { | ||
var cloned = []; | ||
for (var i = 0; i < array.length; i++) { | ||
var object = array[i]; | ||
// Sanity check to make sure it's an object | ||
if (object != null && typeof object._clone == 'function') { | ||
cloned.push(object._clone()); | ||
} | ||
else { | ||
// Ignore any other values | ||
cloned.push(null); | ||
} | ||
} | ||
return cloned; | ||
} | ||
} | ||
exports.ArrayType = ArrayType; | ||
//# sourceMappingURL=ArrayType.js.map |
{ | ||
"name": "@journeyapps/parser-schema", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "Journey JS library", | ||
@@ -14,7 +14,7 @@ "main": "./dist/src/index.js", | ||
"dependencies": { | ||
"@journeyapps/core-xml": "^3.0.3", | ||
"@journeyapps/parser-common": "^3.0.3" | ||
"@journeyapps/core-xml": "^3.0.4", | ||
"@journeyapps/parser-common": "^3.0.4" | ||
}, | ||
"devDependencies": { | ||
"@journeyapps/core-test-helpers": "^3.0.3", | ||
"@journeyapps/core-test-helpers": "^3.0.4", | ||
"@journeyapps/domparser": "^0.3.0" | ||
@@ -26,3 +26,3 @@ }, | ||
], | ||
"gitHead": "83b6401dae1c7c3aeaa8d76c166512bab1a1571a" | ||
"gitHead": "296bf1ca9d8c5563437c9f0c60ab398ef5a7de27" | ||
} |
Sorry, the diff of this file is not supported yet
153810
2002