{"version":3,"file":"mimic-fn-4c5af2e5.js","sources":["../../node_modules/mimic-fn/index.js"],"sourcesContent":["'use strict';\n\nconst copyProperty = (to, from, property, ignoreNonConfigurable) => {\n\t// `Function#length` should reflect the parameters of `to` not `from` since we keep its body.\n\t// `Function#prototype` is non-writable and non-configurable so can never be modified.\n\tif (property === 'length' || property === 'prototype') {\n\t\treturn;\n\t}\n\n\t// `Function#arguments` and `Function#caller` should not be copied. They were reported to be present in `Reflect.ownKeys` for some devices in React Native (#41), so we explicitly ignore them here.\n\tif (property === 'arguments' || property === 'caller') {\n\t\treturn;\n\t}\n\n\tconst toDescriptor = Object.getOwnPropertyDescriptor(to, property);\n\tconst fromDescriptor = Object.getOwnPropertyDescriptor(from, property);\n\n\tif (!canCopyProperty(toDescriptor, fromDescriptor) && ignoreNonConfigurable) {\n\t\treturn;\n\t}\n\n\tObject.defineProperty(to, property, fromDescriptor);\n};\n\n// `Object.defineProperty()` throws if the property exists, is not configurable and either:\n// - one its descriptors is changed\n// - it is non-writable and its value is changed\nconst canCopyProperty = function (toDescriptor, fromDescriptor) {\n\treturn toDescriptor === undefined || toDescriptor.configurable || (\n\t\ttoDescriptor.writable === fromDescriptor.writable &&\n\t\ttoDescriptor.enumerable === fromDescriptor.enumerable &&\n\t\ttoDescriptor.configurable === fromDescriptor.configurable &&\n\t\t(toDescriptor.writable || toDescriptor.value === fromDescriptor.value)\n\t);\n};\n\nconst changePrototype = (to, from) => {\n\tconst fromPrototype = Object.getPrototypeOf(from);\n\tif (fromPrototype === Object.getPrototypeOf(to)) {\n\t\treturn;\n\t}\n\n\tObject.setPrototypeOf(to, fromPrototype);\n};\n\nconst wrappedToString = (withName, fromBody) => `/* Wrapped ${withName}*/\\n${fromBody}`;\n\nconst toStringDescriptor = Object.getOwnPropertyDescriptor(Function.prototype, 'toString');\nconst toStringName = Object.getOwnPropertyDescriptor(Function.prototype.toString, 'name');\n\n// We call `from.toString()` early (not lazily) to ensure `from` can be garbage collected.\n// We use `bind()` instead of a closure for the same reason.\n// Calling `from.toString()` early also allows caching it in case `to.toString()` is called several times.\nconst changeToString = (to, from, name) => {\n\tconst withName = name === '' ? '' : `with ${name.trim()}() `;\n\tconst newToString = wrappedToString.bind(null, withName, from.toString());\n\t// Ensure `to.toString.toString` is non-enumerable and has the same `same`\n\tObject.defineProperty(newToString, 'name', toStringName);\n\tObject.defineProperty(to, 'toString', {...toStringDescriptor, value: newToString});\n};\n\nconst mimicFn = (to, from, {ignoreNonConfigurable = false} = {}) => {\n\tconst {name} = to;\n\n\tfor (const property of Reflect.ownKeys(from)) {\n\t\tcopyProperty(to, from, property, ignoreNonConfigurable);\n\t}\n\n\tchangePrototype(to, from);\n\tchangeToString(to, from, name);\n\n\treturn to;\n};\n\nmodule.exports = mimicFn;\n"],"names":["copyProperty","to","from","property","ignoreNonConfigurable","toDescriptor","fromDescriptor","canCopyProperty","changePrototype","fromPrototype","wrappedToString","withName","fromBody","toStringDescriptor","toStringName","changeToString","name","newToString","mimicFn","mimicFn_1"],"mappings":"AAEA,MAAMA,EAAe,CAACC,EAAIC,EAAMC,EAAUC,IAA0B,CAQnE,GALID,IAAa,UAAYA,IAAa,aAKtCA,IAAa,aAAeA,IAAa,SAC5C,OAGD,MAAME,EAAe,OAAO,yBAAyBJ,EAAIE,CAAQ,EAC3DG,EAAiB,OAAO,yBAAyBJ,EAAMC,CAAQ,EAEjE,CAACI,EAAgBF,EAAcC,CAAc,GAAKF,GAItD,OAAO,eAAeH,EAAIE,EAAUG,CAAc,CACnD,EAKMC,EAAkB,SAAUF,EAAcC,EAAgB,CAC/D,OAAOD,IAAiB,QAAaA,EAAa,cACjDA,EAAa,WAAaC,EAAe,UACzCD,EAAa,aAAeC,EAAe,YAC3CD,EAAa,eAAiBC,EAAe,eAC5CD,EAAa,UAAYA,EAAa,QAAUC,EAAe,MAElE,EAEME,EAAkB,CAACP,EAAIC,IAAS,CACrC,MAAMO,EAAgB,OAAO,eAAeP,CAAI,EAC5CO,IAAkB,OAAO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