@chix/flow
Version:
31 lines • 1.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function checkProperties(node, schema, input, port) {
for (var prop in schema.properties) {
if (schema.properties.hasOwnProperty(prop)) {
var property = schema.properties[prop];
if (!input.hasOwnProperty(prop)) {
if (property.hasOwnProperty('default')) {
input[prop] = property.default;
}
else if (property.required === false) {
input[prop] = undefined;
}
else {
if (property.type === 'object') {
if (property.hasOwnProperty('properties')) {
if (!input.hasOwnProperty(prop)) {
input[prop] = {};
}
return checkProperties(node, property, input[prop], port);
}
}
throw Error(node.identifier + ": Cannot determine input for port `" + port + "`");
}
}
}
}
return;
}
exports.checkProperties = checkProperties;
//# sourceMappingURL=checkProperties.js.map