Gazebo_simulation-Frontend/node_modules/.cache/babel-loader/202648daff7290db4fae52094f3...

1 line
1.4 KiB
JSON

{"ast":null,"code":"\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = builder;\n\nvar _clone = _interopRequireDefault(require(\"lodash/clone\"));\n\nvar _definitions = require(\"../definitions\");\n\nvar _validate = _interopRequireDefault(require(\"../validators/validate\"));\n\nfunction _interopRequireDefault(obj) {\n return obj && obj.__esModule ? obj : {\n default: obj\n };\n}\n\nfunction builder(type) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var keys = _definitions.BUILDER_KEYS[type];\n var countArgs = args.length;\n\n if (countArgs > keys.length) {\n throw new Error(\"\".concat(type, \": Too many arguments passed. Received \").concat(countArgs, \" but can receive no more than \").concat(keys.length));\n }\n\n var node = {\n type: type\n };\n var i = 0;\n keys.forEach(function (key) {\n var field = _definitions.NODE_FIELDS[type][key];\n var arg;\n if (i < countArgs) arg = args[i];\n if (arg === undefined) arg = (0, _clone.default)(field.default);\n node[key] = arg;\n i++;\n });\n\n for (var _i = 0, _Object$keys = Object.keys(node); _i < _Object$keys.length; _i++) {\n var key = _Object$keys[_i];\n (0, _validate.default)(node, key, node[key]);\n }\n\n return node;\n}","map":null,"metadata":{},"sourceType":"script"}