index.js.map 4.0 KB

1
  1. {"version":3,"sources":["index.js"],"names":[],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"index.js","sourcesContent":["\r\nvar __assign = (this && this.__assign) || function () {\r\n __assign = Object.assign || function(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nvar __read = (this && this.__read) || function (o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n};\r\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n};\r\nObject.defineProperty(exports, \"__esModule\", { value: true });\r\n// istanbul ignore next\r\nvar isObject = function (obj) {\r\n if (typeof obj === \"object\" && obj !== null) {\r\n if (typeof Object.getPrototypeOf === \"function\") {\r\n var prototype = Object.getPrototypeOf(obj);\r\n return prototype === Object.prototype || prototype === null;\r\n }\r\n return Object.prototype.toString.call(obj) === \"[object Object]\";\r\n }\r\n return false;\r\n};\r\nvar merge = function () {\r\n var objects = [];\r\n for (var _i = 0; _i < arguments.length; _i++) {\r\n objects[_i] = arguments[_i];\r\n }\r\n return objects.reduce(function (result, current) {\r\n if (Array.isArray(current)) {\r\n throw new TypeError(\"Arguments provided to ts-deepmerge must be objects, not arrays.\");\r\n }\r\n Object.keys(current).forEach(function (key) {\r\n if ([\"__proto__\", \"constructor\", \"prototype\"].includes(key)) {\r\n return;\r\n }\r\n if (Array.isArray(result[key]) && Array.isArray(current[key])) {\r\n result[key] = merge.options.mergeArrays\r\n ? Array.from(new Set(result[key].concat(current[key])))\r\n : current[key];\r\n }\r\n else if (isObject(result[key]) && isObject(current[key])) {\r\n result[key] = merge(result[key], current[key]);\r\n }\r\n else {\r\n result[key] = current[key];\r\n }\r\n });\r\n return result;\r\n }, {});\r\n};\r\nvar defaultOptions = {\r\n mergeArrays: true,\r\n};\r\nmerge.options = defaultOptions;\r\nmerge.withOptions = function (options) {\r\n var objects = [];\r\n for (var _i = 1; _i < arguments.length; _i++) {\r\n objects[_i - 1] = arguments[_i];\r\n }\r\n merge.options = __assign({ mergeArrays: true }, options);\r\n var result = merge.apply(void 0, __spreadArray([], __read(objects), false));\r\n merge.options = defaultOptions;\r\n return result;\r\n};\r\nexports.default = merge;\r\n"]}