@chix/flow
Version:
24 lines • 684 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function getNodeArgument(args) {
if (!args || !args.length) {
throw Error('Not enough arguments.');
}
var _a = args[0], node = _a.node, id = _a.id;
if (!id || typeof id !== 'string') {
throw Error('id parameter is required.');
}
if (!node) {
throw Error('node parameter is required.');
}
if (!node.ns || !node.name) {
console.log(node);
throw Error("Node requires both ns and name.");
}
return {
id: id,
node: node,
};
}
exports.getNodeArgument = getNodeArgument;
//# sourceMappingURL=getNodeArgument.js.map