overridable-fn 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,8 +1,13 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __commonJS = (cb, mod) => function __require() {
9
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
10
+ };
6
11
  var __export = (target, all) => {
7
12
  for (var name in all)
8
13
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -15,15 +20,428 @@ var __copyProps = (to, from, except, desc) => {
15
20
  }
16
21
  return to;
17
22
  };
23
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
18
27
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
28
 
29
+ // node_modules/.pnpm/lodash.assign@4.2.0/node_modules/lodash.assign/index.js
30
+ var require_lodash = __commonJS({
31
+ "node_modules/.pnpm/lodash.assign@4.2.0/node_modules/lodash.assign/index.js"(exports, module2) {
32
+ var MAX_SAFE_INTEGER = 9007199254740991;
33
+ var argsTag = "[object Arguments]";
34
+ var funcTag = "[object Function]";
35
+ var genTag = "[object GeneratorFunction]";
36
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
37
+ function apply(func, thisArg, args) {
38
+ switch (args.length) {
39
+ case 0:
40
+ return func.call(thisArg);
41
+ case 1:
42
+ return func.call(thisArg, args[0]);
43
+ case 2:
44
+ return func.call(thisArg, args[0], args[1]);
45
+ case 3:
46
+ return func.call(thisArg, args[0], args[1], args[2]);
47
+ }
48
+ return func.apply(thisArg, args);
49
+ }
50
+ function baseTimes(n, iteratee) {
51
+ var index = -1, result = Array(n);
52
+ while (++index < n) {
53
+ result[index] = iteratee(index);
54
+ }
55
+ return result;
56
+ }
57
+ function overArg(func, transform) {
58
+ return function(arg) {
59
+ return func(transform(arg));
60
+ };
61
+ }
62
+ var objectProto = Object.prototype;
63
+ var hasOwnProperty = objectProto.hasOwnProperty;
64
+ var objectToString = objectProto.toString;
65
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
66
+ var nativeKeys = overArg(Object.keys, Object);
67
+ var nativeMax = Math.max;
68
+ var nonEnumShadows = !propertyIsEnumerable.call({ "valueOf": 1 }, "valueOf");
69
+ function arrayLikeKeys(value, inherited) {
70
+ var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
71
+ var length = result.length, skipIndexes = !!length;
72
+ for (var key in value) {
73
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
74
+ result.push(key);
75
+ }
76
+ }
77
+ return result;
78
+ }
79
+ function assignValue(object, key, value) {
80
+ var objValue = object[key];
81
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
82
+ object[key] = value;
83
+ }
84
+ }
85
+ function baseKeys(object) {
86
+ if (!isPrototype(object)) {
87
+ return nativeKeys(object);
88
+ }
89
+ var result = [];
90
+ for (var key in Object(object)) {
91
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
92
+ result.push(key);
93
+ }
94
+ }
95
+ return result;
96
+ }
97
+ function baseRest(func, start) {
98
+ start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
99
+ return function() {
100
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
101
+ while (++index < length) {
102
+ array[index] = args[start + index];
103
+ }
104
+ index = -1;
105
+ var otherArgs = Array(start + 1);
106
+ while (++index < start) {
107
+ otherArgs[index] = args[index];
108
+ }
109
+ otherArgs[start] = array;
110
+ return apply(func, this, otherArgs);
111
+ };
112
+ }
113
+ function copyObject(source, props, object, customizer) {
114
+ object || (object = {});
115
+ var index = -1, length = props.length;
116
+ while (++index < length) {
117
+ var key = props[index];
118
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
119
+ assignValue(object, key, newValue === void 0 ? source[key] : newValue);
120
+ }
121
+ return object;
122
+ }
123
+ function createAssigner(assigner) {
124
+ return baseRest(function(object, sources) {
125
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
126
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
127
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
128
+ customizer = length < 3 ? void 0 : customizer;
129
+ length = 1;
130
+ }
131
+ object = Object(object);
132
+ while (++index < length) {
133
+ var source = sources[index];
134
+ if (source) {
135
+ assigner(object, source, index, customizer);
136
+ }
137
+ }
138
+ return object;
139
+ });
140
+ }
141
+ function isIndex(value, length) {
142
+ length = length == null ? MAX_SAFE_INTEGER : length;
143
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
144
+ }
145
+ function isIterateeCall(value, index, object) {
146
+ if (!isObject(object)) {
147
+ return false;
148
+ }
149
+ var type = typeof index;
150
+ if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
151
+ return eq(object[index], value);
152
+ }
153
+ return false;
154
+ }
155
+ function isPrototype(value) {
156
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
157
+ return value === proto;
158
+ }
159
+ function eq(value, other) {
160
+ return value === other || value !== value && other !== other;
161
+ }
162
+ function isArguments(value) {
163
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
164
+ }
165
+ var isArray = Array.isArray;
166
+ function isArrayLike(value) {
167
+ return value != null && isLength(value.length) && !isFunction(value);
168
+ }
169
+ function isArrayLikeObject(value) {
170
+ return isObjectLike(value) && isArrayLike(value);
171
+ }
172
+ function isFunction(value) {
173
+ var tag = isObject(value) ? objectToString.call(value) : "";
174
+ return tag == funcTag || tag == genTag;
175
+ }
176
+ function isLength(value) {
177
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
178
+ }
179
+ function isObject(value) {
180
+ var type = typeof value;
181
+ return !!value && (type == "object" || type == "function");
182
+ }
183
+ function isObjectLike(value) {
184
+ return !!value && typeof value == "object";
185
+ }
186
+ var assign2 = createAssigner(function(object, source) {
187
+ if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
188
+ copyObject(source, keys(source), object);
189
+ return;
190
+ }
191
+ for (var key in source) {
192
+ if (hasOwnProperty.call(source, key)) {
193
+ assignValue(object, key, source[key]);
194
+ }
195
+ }
196
+ });
197
+ function keys(object) {
198
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
199
+ }
200
+ module2.exports = assign2;
201
+ }
202
+ });
203
+
204
+ // node_modules/.pnpm/lodash.memoize@4.1.2/node_modules/lodash.memoize/index.js
205
+ var require_lodash2 = __commonJS({
206
+ "node_modules/.pnpm/lodash.memoize@4.1.2/node_modules/lodash.memoize/index.js"(exports, module2) {
207
+ var FUNC_ERROR_TEXT = "Expected a function";
208
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
209
+ var funcTag = "[object Function]";
210
+ var genTag = "[object GeneratorFunction]";
211
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
212
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
213
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
214
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
215
+ var root = freeGlobal || freeSelf || Function("return this")();
216
+ function getValue(object, key) {
217
+ return object == null ? void 0 : object[key];
218
+ }
219
+ function isHostObject(value) {
220
+ var result = false;
221
+ if (value != null && typeof value.toString != "function") {
222
+ try {
223
+ result = !!(value + "");
224
+ } catch (e) {
225
+ }
226
+ }
227
+ return result;
228
+ }
229
+ var arrayProto = Array.prototype;
230
+ var funcProto = Function.prototype;
231
+ var objectProto = Object.prototype;
232
+ var coreJsData = root["__core-js_shared__"];
233
+ var maskSrcKey = function() {
234
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
235
+ return uid ? "Symbol(src)_1." + uid : "";
236
+ }();
237
+ var funcToString = funcProto.toString;
238
+ var hasOwnProperty = objectProto.hasOwnProperty;
239
+ var objectToString = objectProto.toString;
240
+ var reIsNative = RegExp(
241
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
242
+ );
243
+ var splice = arrayProto.splice;
244
+ var Map = getNative(root, "Map");
245
+ var nativeCreate = getNative(Object, "create");
246
+ function Hash(entries) {
247
+ var index = -1, length = entries ? entries.length : 0;
248
+ this.clear();
249
+ while (++index < length) {
250
+ var entry = entries[index];
251
+ this.set(entry[0], entry[1]);
252
+ }
253
+ }
254
+ function hashClear() {
255
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
256
+ }
257
+ function hashDelete(key) {
258
+ return this.has(key) && delete this.__data__[key];
259
+ }
260
+ function hashGet(key) {
261
+ var data = this.__data__;
262
+ if (nativeCreate) {
263
+ var result = data[key];
264
+ return result === HASH_UNDEFINED ? void 0 : result;
265
+ }
266
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
267
+ }
268
+ function hashHas(key) {
269
+ var data = this.__data__;
270
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
271
+ }
272
+ function hashSet(key, value) {
273
+ var data = this.__data__;
274
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
275
+ return this;
276
+ }
277
+ Hash.prototype.clear = hashClear;
278
+ Hash.prototype["delete"] = hashDelete;
279
+ Hash.prototype.get = hashGet;
280
+ Hash.prototype.has = hashHas;
281
+ Hash.prototype.set = hashSet;
282
+ function ListCache(entries) {
283
+ var index = -1, length = entries ? entries.length : 0;
284
+ this.clear();
285
+ while (++index < length) {
286
+ var entry = entries[index];
287
+ this.set(entry[0], entry[1]);
288
+ }
289
+ }
290
+ function listCacheClear() {
291
+ this.__data__ = [];
292
+ }
293
+ function listCacheDelete(key) {
294
+ var data = this.__data__, index = assocIndexOf(data, key);
295
+ if (index < 0) {
296
+ return false;
297
+ }
298
+ var lastIndex = data.length - 1;
299
+ if (index == lastIndex) {
300
+ data.pop();
301
+ } else {
302
+ splice.call(data, index, 1);
303
+ }
304
+ return true;
305
+ }
306
+ function listCacheGet(key) {
307
+ var data = this.__data__, index = assocIndexOf(data, key);
308
+ return index < 0 ? void 0 : data[index][1];
309
+ }
310
+ function listCacheHas(key) {
311
+ return assocIndexOf(this.__data__, key) > -1;
312
+ }
313
+ function listCacheSet(key, value) {
314
+ var data = this.__data__, index = assocIndexOf(data, key);
315
+ if (index < 0) {
316
+ data.push([key, value]);
317
+ } else {
318
+ data[index][1] = value;
319
+ }
320
+ return this;
321
+ }
322
+ ListCache.prototype.clear = listCacheClear;
323
+ ListCache.prototype["delete"] = listCacheDelete;
324
+ ListCache.prototype.get = listCacheGet;
325
+ ListCache.prototype.has = listCacheHas;
326
+ ListCache.prototype.set = listCacheSet;
327
+ function MapCache(entries) {
328
+ var index = -1, length = entries ? entries.length : 0;
329
+ this.clear();
330
+ while (++index < length) {
331
+ var entry = entries[index];
332
+ this.set(entry[0], entry[1]);
333
+ }
334
+ }
335
+ function mapCacheClear() {
336
+ this.__data__ = {
337
+ "hash": new Hash(),
338
+ "map": new (Map || ListCache)(),
339
+ "string": new Hash()
340
+ };
341
+ }
342
+ function mapCacheDelete(key) {
343
+ return getMapData(this, key)["delete"](key);
344
+ }
345
+ function mapCacheGet(key) {
346
+ return getMapData(this, key).get(key);
347
+ }
348
+ function mapCacheHas(key) {
349
+ return getMapData(this, key).has(key);
350
+ }
351
+ function mapCacheSet(key, value) {
352
+ getMapData(this, key).set(key, value);
353
+ return this;
354
+ }
355
+ MapCache.prototype.clear = mapCacheClear;
356
+ MapCache.prototype["delete"] = mapCacheDelete;
357
+ MapCache.prototype.get = mapCacheGet;
358
+ MapCache.prototype.has = mapCacheHas;
359
+ MapCache.prototype.set = mapCacheSet;
360
+ function assocIndexOf(array, key) {
361
+ var length = array.length;
362
+ while (length--) {
363
+ if (eq(array[length][0], key)) {
364
+ return length;
365
+ }
366
+ }
367
+ return -1;
368
+ }
369
+ function baseIsNative(value) {
370
+ if (!isObject(value) || isMasked(value)) {
371
+ return false;
372
+ }
373
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
374
+ return pattern.test(toSource(value));
375
+ }
376
+ function getMapData(map, key) {
377
+ var data = map.__data__;
378
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
379
+ }
380
+ function getNative(object, key) {
381
+ var value = getValue(object, key);
382
+ return baseIsNative(value) ? value : void 0;
383
+ }
384
+ function isKeyable(value) {
385
+ var type = typeof value;
386
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
387
+ }
388
+ function isMasked(func) {
389
+ return !!maskSrcKey && maskSrcKey in func;
390
+ }
391
+ function toSource(func) {
392
+ if (func != null) {
393
+ try {
394
+ return funcToString.call(func);
395
+ } catch (e) {
396
+ }
397
+ try {
398
+ return func + "";
399
+ } catch (e) {
400
+ }
401
+ }
402
+ return "";
403
+ }
404
+ function memoize2(func, resolver) {
405
+ if (typeof func != "function" || resolver && typeof resolver != "function") {
406
+ throw new TypeError(FUNC_ERROR_TEXT);
407
+ }
408
+ var memoized = function() {
409
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
410
+ if (cache.has(key)) {
411
+ return cache.get(key);
412
+ }
413
+ var result = func.apply(this, args);
414
+ memoized.cache = cache.set(key, result);
415
+ return result;
416
+ };
417
+ memoized.cache = new (memoize2.Cache || MapCache)();
418
+ return memoized;
419
+ }
420
+ memoize2.Cache = MapCache;
421
+ function eq(value, other) {
422
+ return value === other || value !== value && other !== other;
423
+ }
424
+ function isFunction(value) {
425
+ var tag = isObject(value) ? objectToString.call(value) : "";
426
+ return tag == funcTag || tag == genTag;
427
+ }
428
+ function isObject(value) {
429
+ var type = typeof value;
430
+ return !!value && (type == "object" || type == "function");
431
+ }
432
+ module2.exports = memoize2;
433
+ }
434
+ });
435
+
20
436
  // src/index.ts
21
437
  var src_exports = {};
22
438
  __export(src_exports, {
23
439
  fn: () => fn
24
440
  });
25
441
  module.exports = __toCommonJS(src_exports);
26
- var fn = (defaultImpl) => {
442
+ var import_lodash = __toESM(require_lodash(), 1);
443
+ var import_lodash2 = __toESM(require_lodash2(), 1);
444
+ var _fn = (defaultImpl) => {
27
445
  let impl = defaultImpl;
28
446
  const unwrap = () => impl;
29
447
  const override = (provideImpl) => {
@@ -41,6 +459,19 @@ var fn = (defaultImpl) => {
41
459
  invoker.override = override;
42
460
  return invoker;
43
461
  };
462
+ var fn = (0, import_lodash.default)(_fn, {
463
+ memo: (defaultImpl) => {
464
+ const memoized = (0, import_lodash2.default)(defaultImpl);
465
+ return (0, import_lodash.default)(fn(memoized), {
466
+ get cache() {
467
+ return memoized.cache;
468
+ },
469
+ set cache(cache) {
470
+ memoized.cache = cache;
471
+ }
472
+ });
473
+ }
474
+ });
44
475
  // Annotate the CommonJS export names for ESM import in node:
45
476
  0 && (module.exports = {
46
477
  fn
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface FnImpl<TArgs extends any[], TRet> {\n (...args: TArgs): TRet;\n}\n\nexport interface WrappedFnImpl<TArgs extends any[], TRet> {\n (...args: TArgs): TRet;\n unwrap: () => FnImpl<TArgs, TRet>;\n override: (\n provideImpl: (curImpl: FnImpl<TArgs, TRet>) => FnImpl<TArgs, TRet>\n ) => {\n restore: () => void\n }\n}\n\nexport const fn = <TArgs extends any[], TRet>(\n defaultImpl: FnImpl<TArgs, TRet>\n): WrappedFnImpl<TArgs, TRet> => {\n let impl = defaultImpl;\n\n const unwrap = () => impl;\n\n const override = (\n provideImpl: (curImpl: FnImpl<TArgs, TRet>) => FnImpl<TArgs, TRet>\n ) => {\n const curImpl = impl\n impl = provideImpl(curImpl);\n const restore = () => {\n impl = curImpl\n }\n return { restore }\n };\n\n const invoker: WrappedFnImpl<TArgs, TRet> = (...args) => {\n return impl(...args);\n };\n\n invoker.unwrap = unwrap;\n invoker.override = override;\n\n return invoker;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,IAAM,KAAK,CACd,gBAC6B;AAC7B,MAAI,OAAO;AAEX,QAAM,SAAS,MAAM;AAErB,QAAM,WAAW,CACb,gBACC;AACD,UAAM,UAAU;AAChB,WAAO,YAAY,OAAO;AAC1B,UAAM,UAAU,MAAM;AAClB,aAAO;AAAA,IACX;AACA,WAAO,EAAE,QAAQ;AAAA,EACrB;AAEA,QAAM,UAAsC,IAAI,SAAS;AACrD,WAAO,KAAK,GAAG,IAAI;AAAA,EACvB;AAEA,UAAQ,SAAS;AACjB,UAAQ,WAAW;AAEnB,SAAO;AACX;","names":[]}
1
+ {"version":3,"sources":["../node_modules/.pnpm/lodash.assign@4.2.0/node_modules/lodash.assign/index.js","../node_modules/.pnpm/lodash.memoize@4.1.2/node_modules/lodash.memoize/index.js","../src/index.ts"],"sourcesContent":["/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */\nvar nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = assign;\n","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\nmodule.exports = memoize;\n","import assign from \"lodash.assign\";\nimport memoize from \"lodash.memoize\";\n\nexport interface FnImpl<TArgs extends any[], TRet> {\n (...args: TArgs): TRet;\n}\n\nexport interface WrappedFnImpl<TArgs extends any[], TRet> {\n (...args: TArgs): TRet;\n unwrap: () => FnImpl<TArgs, TRet>;\n override: (\n provideImpl: (curImpl: FnImpl<TArgs, TRet>) => FnImpl<TArgs, TRet>\n ) => {\n restore: () => void\n }\n}\n\nconst _fn = <TArgs extends any[], TRet>(\n defaultImpl: FnImpl<TArgs, TRet>\n): WrappedFnImpl<TArgs, TRet> => {\n let impl = defaultImpl;\n\n const unwrap = () => impl;\n\n const override = (\n provideImpl: (curImpl: FnImpl<TArgs, TRet>) => FnImpl<TArgs, TRet>\n ) => {\n const curImpl = impl\n impl = provideImpl(curImpl);\n const restore = () => {\n impl = curImpl\n }\n return { restore }\n };\n\n const invoker: WrappedFnImpl<TArgs, TRet> = (...args) => {\n return impl(...args);\n };\n\n invoker.unwrap = unwrap;\n invoker.override = override;\n\n return invoker;\n};\n\n\nexport const fn = assign(_fn, {\n memo: <TArgs extends any[], TRet>(defaultImpl: FnImpl<TArgs, TRet>) => {\n const memoized = memoize(defaultImpl) \n return assign(fn(memoized), {\n get cache() {\n return memoized.cache;\n },\n set cache(cache: typeof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AU,SAAU,UAAU,SAAS,UAAU;AAAA,IAC1D;AAmBA,aAAS,WAAW,OAAO;AAGzB,UAAI,MAAM,SAAS,KAAK,IAAI,eAAe,KAAK,KAAK,IAAI;AACzD,aAAO,OAAO,WAAW,OAAO;AAAA,IAClC;AA2BA,aAAS,SAAS,OAAO;AACvB,UAAI,OAAO,OAAO;AAClB,aAAO,CAAC,CAAC,UAAU,QAAQ,YAAY,QAAQ;AAAA,IACjD;AAEA,IAAAD,QAAO,UAAUC;AAAA;AAAA;;;ACnqBjB;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AACnB,IAAAC,iBAAoB;AAgBpB,IAAM,MAAM,CACR,gBAC6B;AAC7B,MAAI,OAAO;AAEX,QAAM,SAAS,MAAM;AAErB,QAAM,WAAW,CACb,gBACC;AACD,UAAM,UAAU;AAChB,WAAO,YAAY,OAAO;AAC1B,UAAM,UAAU,MAAM;AAClB,aAAO;AAAA,IACX;AACA,WAAO,EAAE,QAAQ;AAAA,EACrB;AAEA,QAAM,UAAsC,IAAI,SAAS;AACrD,WAAO,KAAK,GAAG,IAAI;AAAA,EACvB;AAEA,UAAQ,SAAS;AACjB,UAAQ,WAAW;AAEnB,SAAO;AACX;AAGO,IAAM,SAAK,cAAAC,SAAO,KAAK;AAAA,EAC1B,MAAM,CAA4B,gBAAqC;AACnE,UAAM,eAAW,eAAAC,SAAQ,WAAW;AACpC,eAAO,cAAAD,SAAO,GAAG,QAAQ,GAAG;AAAA,MACxB,IAAI,QAAQ;AACR,eAAO,SAAS;AAAA,MACpB;AAAA,MACA,IAAI,MAAM,OAA8B;AACpC,iBAAS,QAAQ;AAAA,MACrB;AAAA,IACJ,CAAC;AAAA,EACL;AACJ,CAAC;","names":["module","assign","require_lodash","module","memoize","import_lodash","assign","memoize"]}
package/dist/index.d.ts CHANGED
@@ -1,3 +1,5 @@
1
+ import * as lodash from 'lodash';
2
+
1
3
  interface FnImpl<TArgs extends any[], TRet> {
2
4
  (...args: TArgs): TRet;
3
5
  }
@@ -8,6 +10,10 @@ interface WrappedFnImpl<TArgs extends any[], TRet> {
8
10
  restore: () => void;
9
11
  };
10
12
  }
11
- declare const fn: <TArgs extends any[], TRet>(defaultImpl: FnImpl<TArgs, TRet>) => WrappedFnImpl<TArgs, TRet>;
13
+ declare const fn: (<TArgs extends any[], TRet>(defaultImpl: FnImpl<TArgs, TRet>) => WrappedFnImpl<TArgs, TRet>) & {
14
+ memo: <TArgs_1 extends any[], TRet_1>(defaultImpl: FnImpl<TArgs_1, TRet_1>) => WrappedFnImpl<TArgs_1, TRet_1> & {
15
+ cache: lodash.MapCache;
16
+ };
17
+ };
12
18
 
13
19
  export { FnImpl, WrappedFnImpl, fn };
package/dist/index.js CHANGED
@@ -1,5 +1,436 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __commonJS = (cb, mod) => function __require() {
8
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
20
+ mod
21
+ ));
22
+
23
+ // node_modules/.pnpm/lodash.assign@4.2.0/node_modules/lodash.assign/index.js
24
+ var require_lodash = __commonJS({
25
+ "node_modules/.pnpm/lodash.assign@4.2.0/node_modules/lodash.assign/index.js"(exports, module) {
26
+ var MAX_SAFE_INTEGER = 9007199254740991;
27
+ var argsTag = "[object Arguments]";
28
+ var funcTag = "[object Function]";
29
+ var genTag = "[object GeneratorFunction]";
30
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
31
+ function apply(func, thisArg, args) {
32
+ switch (args.length) {
33
+ case 0:
34
+ return func.call(thisArg);
35
+ case 1:
36
+ return func.call(thisArg, args[0]);
37
+ case 2:
38
+ return func.call(thisArg, args[0], args[1]);
39
+ case 3:
40
+ return func.call(thisArg, args[0], args[1], args[2]);
41
+ }
42
+ return func.apply(thisArg, args);
43
+ }
44
+ function baseTimes(n, iteratee) {
45
+ var index = -1, result = Array(n);
46
+ while (++index < n) {
47
+ result[index] = iteratee(index);
48
+ }
49
+ return result;
50
+ }
51
+ function overArg(func, transform) {
52
+ return function(arg) {
53
+ return func(transform(arg));
54
+ };
55
+ }
56
+ var objectProto = Object.prototype;
57
+ var hasOwnProperty = objectProto.hasOwnProperty;
58
+ var objectToString = objectProto.toString;
59
+ var propertyIsEnumerable = objectProto.propertyIsEnumerable;
60
+ var nativeKeys = overArg(Object.keys, Object);
61
+ var nativeMax = Math.max;
62
+ var nonEnumShadows = !propertyIsEnumerable.call({ "valueOf": 1 }, "valueOf");
63
+ function arrayLikeKeys(value, inherited) {
64
+ var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : [];
65
+ var length = result.length, skipIndexes = !!length;
66
+ for (var key in value) {
67
+ if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) {
68
+ result.push(key);
69
+ }
70
+ }
71
+ return result;
72
+ }
73
+ function assignValue(object, key, value) {
74
+ var objValue = object[key];
75
+ if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || value === void 0 && !(key in object)) {
76
+ object[key] = value;
77
+ }
78
+ }
79
+ function baseKeys(object) {
80
+ if (!isPrototype(object)) {
81
+ return nativeKeys(object);
82
+ }
83
+ var result = [];
84
+ for (var key in Object(object)) {
85
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
86
+ result.push(key);
87
+ }
88
+ }
89
+ return result;
90
+ }
91
+ function baseRest(func, start) {
92
+ start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
93
+ return function() {
94
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
95
+ while (++index < length) {
96
+ array[index] = args[start + index];
97
+ }
98
+ index = -1;
99
+ var otherArgs = Array(start + 1);
100
+ while (++index < start) {
101
+ otherArgs[index] = args[index];
102
+ }
103
+ otherArgs[start] = array;
104
+ return apply(func, this, otherArgs);
105
+ };
106
+ }
107
+ function copyObject(source, props, object, customizer) {
108
+ object || (object = {});
109
+ var index = -1, length = props.length;
110
+ while (++index < length) {
111
+ var key = props[index];
112
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
113
+ assignValue(object, key, newValue === void 0 ? source[key] : newValue);
114
+ }
115
+ return object;
116
+ }
117
+ function createAssigner(assigner) {
118
+ return baseRest(function(object, sources) {
119
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
120
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
121
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
122
+ customizer = length < 3 ? void 0 : customizer;
123
+ length = 1;
124
+ }
125
+ object = Object(object);
126
+ while (++index < length) {
127
+ var source = sources[index];
128
+ if (source) {
129
+ assigner(object, source, index, customizer);
130
+ }
131
+ }
132
+ return object;
133
+ });
134
+ }
135
+ function isIndex(value, length) {
136
+ length = length == null ? MAX_SAFE_INTEGER : length;
137
+ return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
138
+ }
139
+ function isIterateeCall(value, index, object) {
140
+ if (!isObject(object)) {
141
+ return false;
142
+ }
143
+ var type = typeof index;
144
+ if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) {
145
+ return eq(object[index], value);
146
+ }
147
+ return false;
148
+ }
149
+ function isPrototype(value) {
150
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto;
151
+ return value === proto;
152
+ }
153
+ function eq(value, other) {
154
+ return value === other || value !== value && other !== other;
155
+ }
156
+ function isArguments(value) {
157
+ return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag);
158
+ }
159
+ var isArray = Array.isArray;
160
+ function isArrayLike(value) {
161
+ return value != null && isLength(value.length) && !isFunction(value);
162
+ }
163
+ function isArrayLikeObject(value) {
164
+ return isObjectLike(value) && isArrayLike(value);
165
+ }
166
+ function isFunction(value) {
167
+ var tag = isObject(value) ? objectToString.call(value) : "";
168
+ return tag == funcTag || tag == genTag;
169
+ }
170
+ function isLength(value) {
171
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;
172
+ }
173
+ function isObject(value) {
174
+ var type = typeof value;
175
+ return !!value && (type == "object" || type == "function");
176
+ }
177
+ function isObjectLike(value) {
178
+ return !!value && typeof value == "object";
179
+ }
180
+ var assign2 = createAssigner(function(object, source) {
181
+ if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {
182
+ copyObject(source, keys(source), object);
183
+ return;
184
+ }
185
+ for (var key in source) {
186
+ if (hasOwnProperty.call(source, key)) {
187
+ assignValue(object, key, source[key]);
188
+ }
189
+ }
190
+ });
191
+ function keys(object) {
192
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
193
+ }
194
+ module.exports = assign2;
195
+ }
196
+ });
197
+
198
+ // node_modules/.pnpm/lodash.memoize@4.1.2/node_modules/lodash.memoize/index.js
199
+ var require_lodash2 = __commonJS({
200
+ "node_modules/.pnpm/lodash.memoize@4.1.2/node_modules/lodash.memoize/index.js"(exports, module) {
201
+ var FUNC_ERROR_TEXT = "Expected a function";
202
+ var HASH_UNDEFINED = "__lodash_hash_undefined__";
203
+ var funcTag = "[object Function]";
204
+ var genTag = "[object GeneratorFunction]";
205
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
206
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
207
+ var freeGlobal = typeof global == "object" && global && global.Object === Object && global;
208
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
209
+ var root = freeGlobal || freeSelf || Function("return this")();
210
+ function getValue(object, key) {
211
+ return object == null ? void 0 : object[key];
212
+ }
213
+ function isHostObject(value) {
214
+ var result = false;
215
+ if (value != null && typeof value.toString != "function") {
216
+ try {
217
+ result = !!(value + "");
218
+ } catch (e) {
219
+ }
220
+ }
221
+ return result;
222
+ }
223
+ var arrayProto = Array.prototype;
224
+ var funcProto = Function.prototype;
225
+ var objectProto = Object.prototype;
226
+ var coreJsData = root["__core-js_shared__"];
227
+ var maskSrcKey = function() {
228
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
229
+ return uid ? "Symbol(src)_1." + uid : "";
230
+ }();
231
+ var funcToString = funcProto.toString;
232
+ var hasOwnProperty = objectProto.hasOwnProperty;
233
+ var objectToString = objectProto.toString;
234
+ var reIsNative = RegExp(
235
+ "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
236
+ );
237
+ var splice = arrayProto.splice;
238
+ var Map = getNative(root, "Map");
239
+ var nativeCreate = getNative(Object, "create");
240
+ function Hash(entries) {
241
+ var index = -1, length = entries ? entries.length : 0;
242
+ this.clear();
243
+ while (++index < length) {
244
+ var entry = entries[index];
245
+ this.set(entry[0], entry[1]);
246
+ }
247
+ }
248
+ function hashClear() {
249
+ this.__data__ = nativeCreate ? nativeCreate(null) : {};
250
+ }
251
+ function hashDelete(key) {
252
+ return this.has(key) && delete this.__data__[key];
253
+ }
254
+ function hashGet(key) {
255
+ var data = this.__data__;
256
+ if (nativeCreate) {
257
+ var result = data[key];
258
+ return result === HASH_UNDEFINED ? void 0 : result;
259
+ }
260
+ return hasOwnProperty.call(data, key) ? data[key] : void 0;
261
+ }
262
+ function hashHas(key) {
263
+ var data = this.__data__;
264
+ return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key);
265
+ }
266
+ function hashSet(key, value) {
267
+ var data = this.__data__;
268
+ data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value;
269
+ return this;
270
+ }
271
+ Hash.prototype.clear = hashClear;
272
+ Hash.prototype["delete"] = hashDelete;
273
+ Hash.prototype.get = hashGet;
274
+ Hash.prototype.has = hashHas;
275
+ Hash.prototype.set = hashSet;
276
+ function ListCache(entries) {
277
+ var index = -1, length = entries ? entries.length : 0;
278
+ this.clear();
279
+ while (++index < length) {
280
+ var entry = entries[index];
281
+ this.set(entry[0], entry[1]);
282
+ }
283
+ }
284
+ function listCacheClear() {
285
+ this.__data__ = [];
286
+ }
287
+ function listCacheDelete(key) {
288
+ var data = this.__data__, index = assocIndexOf(data, key);
289
+ if (index < 0) {
290
+ return false;
291
+ }
292
+ var lastIndex = data.length - 1;
293
+ if (index == lastIndex) {
294
+ data.pop();
295
+ } else {
296
+ splice.call(data, index, 1);
297
+ }
298
+ return true;
299
+ }
300
+ function listCacheGet(key) {
301
+ var data = this.__data__, index = assocIndexOf(data, key);
302
+ return index < 0 ? void 0 : data[index][1];
303
+ }
304
+ function listCacheHas(key) {
305
+ return assocIndexOf(this.__data__, key) > -1;
306
+ }
307
+ function listCacheSet(key, value) {
308
+ var data = this.__data__, index = assocIndexOf(data, key);
309
+ if (index < 0) {
310
+ data.push([key, value]);
311
+ } else {
312
+ data[index][1] = value;
313
+ }
314
+ return this;
315
+ }
316
+ ListCache.prototype.clear = listCacheClear;
317
+ ListCache.prototype["delete"] = listCacheDelete;
318
+ ListCache.prototype.get = listCacheGet;
319
+ ListCache.prototype.has = listCacheHas;
320
+ ListCache.prototype.set = listCacheSet;
321
+ function MapCache(entries) {
322
+ var index = -1, length = entries ? entries.length : 0;
323
+ this.clear();
324
+ while (++index < length) {
325
+ var entry = entries[index];
326
+ this.set(entry[0], entry[1]);
327
+ }
328
+ }
329
+ function mapCacheClear() {
330
+ this.__data__ = {
331
+ "hash": new Hash(),
332
+ "map": new (Map || ListCache)(),
333
+ "string": new Hash()
334
+ };
335
+ }
336
+ function mapCacheDelete(key) {
337
+ return getMapData(this, key)["delete"](key);
338
+ }
339
+ function mapCacheGet(key) {
340
+ return getMapData(this, key).get(key);
341
+ }
342
+ function mapCacheHas(key) {
343
+ return getMapData(this, key).has(key);
344
+ }
345
+ function mapCacheSet(key, value) {
346
+ getMapData(this, key).set(key, value);
347
+ return this;
348
+ }
349
+ MapCache.prototype.clear = mapCacheClear;
350
+ MapCache.prototype["delete"] = mapCacheDelete;
351
+ MapCache.prototype.get = mapCacheGet;
352
+ MapCache.prototype.has = mapCacheHas;
353
+ MapCache.prototype.set = mapCacheSet;
354
+ function assocIndexOf(array, key) {
355
+ var length = array.length;
356
+ while (length--) {
357
+ if (eq(array[length][0], key)) {
358
+ return length;
359
+ }
360
+ }
361
+ return -1;
362
+ }
363
+ function baseIsNative(value) {
364
+ if (!isObject(value) || isMasked(value)) {
365
+ return false;
366
+ }
367
+ var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor;
368
+ return pattern.test(toSource(value));
369
+ }
370
+ function getMapData(map, key) {
371
+ var data = map.__data__;
372
+ return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map;
373
+ }
374
+ function getNative(object, key) {
375
+ var value = getValue(object, key);
376
+ return baseIsNative(value) ? value : void 0;
377
+ }
378
+ function isKeyable(value) {
379
+ var type = typeof value;
380
+ return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null;
381
+ }
382
+ function isMasked(func) {
383
+ return !!maskSrcKey && maskSrcKey in func;
384
+ }
385
+ function toSource(func) {
386
+ if (func != null) {
387
+ try {
388
+ return funcToString.call(func);
389
+ } catch (e) {
390
+ }
391
+ try {
392
+ return func + "";
393
+ } catch (e) {
394
+ }
395
+ }
396
+ return "";
397
+ }
398
+ function memoize2(func, resolver) {
399
+ if (typeof func != "function" || resolver && typeof resolver != "function") {
400
+ throw new TypeError(FUNC_ERROR_TEXT);
401
+ }
402
+ var memoized = function() {
403
+ var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache;
404
+ if (cache.has(key)) {
405
+ return cache.get(key);
406
+ }
407
+ var result = func.apply(this, args);
408
+ memoized.cache = cache.set(key, result);
409
+ return result;
410
+ };
411
+ memoized.cache = new (memoize2.Cache || MapCache)();
412
+ return memoized;
413
+ }
414
+ memoize2.Cache = MapCache;
415
+ function eq(value, other) {
416
+ return value === other || value !== value && other !== other;
417
+ }
418
+ function isFunction(value) {
419
+ var tag = isObject(value) ? objectToString.call(value) : "";
420
+ return tag == funcTag || tag == genTag;
421
+ }
422
+ function isObject(value) {
423
+ var type = typeof value;
424
+ return !!value && (type == "object" || type == "function");
425
+ }
426
+ module.exports = memoize2;
427
+ }
428
+ });
429
+
1
430
  // src/index.ts
2
- var fn = (defaultImpl) => {
431
+ var import_lodash = __toESM(require_lodash(), 1);
432
+ var import_lodash2 = __toESM(require_lodash2(), 1);
433
+ var _fn = (defaultImpl) => {
3
434
  let impl = defaultImpl;
4
435
  const unwrap = () => impl;
5
436
  const override = (provideImpl) => {
@@ -17,6 +448,19 @@ var fn = (defaultImpl) => {
17
448
  invoker.override = override;
18
449
  return invoker;
19
450
  };
451
+ var fn = (0, import_lodash.default)(_fn, {
452
+ memo: (defaultImpl) => {
453
+ const memoized = (0, import_lodash2.default)(defaultImpl);
454
+ return (0, import_lodash.default)(fn(memoized), {
455
+ get cache() {
456
+ return memoized.cache;
457
+ },
458
+ set cache(cache) {
459
+ memoized.cache = cache;
460
+ }
461
+ });
462
+ }
463
+ });
20
464
  export {
21
465
  fn
22
466
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export interface FnImpl<TArgs extends any[], TRet> {\n (...args: TArgs): TRet;\n}\n\nexport interface WrappedFnImpl<TArgs extends any[], TRet> {\n (...args: TArgs): TRet;\n unwrap: () => FnImpl<TArgs, TRet>;\n override: (\n provideImpl: (curImpl: FnImpl<TArgs, TRet>) => FnImpl<TArgs, TRet>\n ) => {\n restore: () => void\n }\n}\n\nexport const fn = <TArgs extends any[], TRet>(\n defaultImpl: FnImpl<TArgs, TRet>\n): WrappedFnImpl<TArgs, TRet> => {\n let impl = defaultImpl;\n\n const unwrap = () => impl;\n\n const override = (\n provideImpl: (curImpl: FnImpl<TArgs, TRet>) => FnImpl<TArgs, TRet>\n ) => {\n const curImpl = impl\n impl = provideImpl(curImpl);\n const restore = () => {\n impl = curImpl\n }\n return { restore }\n };\n\n const invoker: WrappedFnImpl<TArgs, TRet> = (...args) => {\n return impl(...args);\n };\n\n invoker.unwrap = unwrap;\n invoker.override = override;\n\n return invoker;\n};\n"],"mappings":";AAcO,IAAM,KAAK,CACd,gBAC6B;AAC7B,MAAI,OAAO;AAEX,QAAM,SAAS,MAAM;AAErB,QAAM,WAAW,CACb,gBACC;AACD,UAAM,UAAU;AAChB,WAAO,YAAY,OAAO;AAC1B,UAAM,UAAU,MAAM;AAClB,aAAO;AAAA,IACX;AACA,WAAO,EAAE,QAAQ;AAAA,EACrB;AAEA,QAAM,UAAsC,IAAI,SAAS;AACrD,WAAO,KAAK,GAAG,IAAI;AAAA,EACvB;AAEA,UAAQ,SAAS;AACjB,UAAQ,WAAW;AAEnB,SAAO;AACX;","names":[]}
1
+ {"version":3,"sources":["../node_modules/.pnpm/lodash.assign@4.2.0/node_modules/lodash.assign/index.js","../node_modules/.pnpm/lodash.memoize@4.1.2/node_modules/lodash.memoize/index.js","../src/index.ts"],"sourcesContent":["/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\n/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\n/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object),\n nativeMax = Math.max;\n\n/** Detect if properties shadowing those on `Object.prototype` are non-enumerable. */\nvar nonEnumShadows = !propertyIsEnumerable.call({ 'valueOf': 1 }, 'valueOf');\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n // Safari 9 makes `arguments.length` enumerable in strict mode.\n var result = (isArray(value) || isArguments(value))\n ? baseTimes(value.length, String)\n : [];\n\n var length = result.length,\n skipIndexes = !!length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (key == 'length' || isIndex(key, length)))) {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n object[key] = value;\n }\n}\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = array;\n return apply(func, this, otherArgs);\n };\n}\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n assignValue(object, key, newValue === undefined ? source[key] : newValue);\n }\n return object;\n}\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n length = length == null ? MAX_SAFE_INTEGER : length;\n return !!length &&\n (typeof value == 'number' || reIsUint.test(value)) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nfunction isArguments(value) {\n // Safari 8.1 makes `arguments.callee` enumerable in strict mode.\n return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') &&\n (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag);\n}\n\n/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Assigns own enumerable string keyed properties of source objects to the\n * destination object. Source objects are applied from left to right.\n * Subsequent sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object` and is loosely based on\n * [`Object.assign`](https://mdn.io/Object/assign).\n *\n * @static\n * @memberOf _\n * @since 0.10.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @see _.assignIn\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * function Bar() {\n * this.c = 3;\n * }\n *\n * Foo.prototype.b = 2;\n * Bar.prototype.d = 4;\n *\n * _.assign({ 'a': 0 }, new Foo, new Bar);\n * // => { 'a': 1, 'c': 3 }\n */\nvar assign = createAssigner(function(object, source) {\n if (nonEnumShadows || isPrototype(source) || isArrayLike(source)) {\n copyObject(source, keys(source), object);\n return;\n }\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n assignValue(object, key, source[key]);\n }\n }\n});\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = assign;\n","/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** `Object#toString` result references. */\nvar funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]';\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\n/**\n * Checks if `value` is a host object in IE < 9.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a host object, else `false`.\n */\nfunction isHostObject(value) {\n // Many host objects are `Object` objects that can coerce to strings\n // despite having improperly defined `toString` methods.\n var result = false;\n if (value != null && typeof value.toString != 'function') {\n try {\n result = !!(value + '');\n } catch (e) {}\n }\n return result;\n}\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype,\n funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map'),\n nativeCreate = getNative(Object, 'create');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n}\n\n/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n return this.has(key) && delete this.__data__[key];\n}\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);\n}\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n}\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n return true;\n}\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries ? entries.length : 0;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n return getMapData(this, key)['delete'](key);\n}\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n getMapData(this, key).set(key, value);\n return this;\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\n/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to process.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result);\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Assign cache to `_.memoize`.\nmemoize.Cache = MapCache;\n\n/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 8-9 which returns 'object' for typed array and other constructors.\n var tag = isObject(value) ? objectToString.call(value) : '';\n return tag == funcTag || tag == genTag;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\nmodule.exports = memoize;\n","import assign from \"lodash.assign\";\nimport memoize from \"lodash.memoize\";\n\nexport interface FnImpl<TArgs extends any[], TRet> {\n (...args: TArgs): TRet;\n}\n\nexport interface WrappedFnImpl<TArgs extends any[], TRet> {\n (...args: TArgs): TRet;\n unwrap: () => FnImpl<TArgs, TRet>;\n override: (\n provideImpl: (curImpl: FnImpl<TArgs, TRet>) => FnImpl<TArgs, TRet>\n ) => {\n restore: () => void\n }\n}\n\nconst _fn = <TArgs extends any[], TRet>(\n defaultImpl: FnImpl<TArgs, TRet>\n): WrappedFnImpl<TArgs, TRet> => {\n let impl = defaultImpl;\n\n const unwrap = () => impl;\n\n const override = (\n provideImpl: (curImpl: FnImpl<TArgs, TRet>) => FnImpl<TArgs, TRet>\n ) => {\n const curImpl = impl\n impl = provideImpl(curImpl);\n const restore = () => {\n impl = curImpl\n }\n return { restore }\n };\n\n const invoker: WrappedFnImpl<TArgs, TRet> = (...args) => {\n return impl(...args);\n };\n\n invoker.unwrap = unwrap;\n invoker.override = override;\n\n return invoker;\n};\n\n\nexport const fn = assign(_fn, {\n memo: <TArgs extends any[], TRet>(defaultImpl: FnImpl<TArgs, TRet>) => {\n const memoized = memoize(defaultImpl) \n return assign(fn(memoized), {\n get cache() {\n return memoized.cache;\n },\n set cache(cache: typeof memoized.cache) {\n memoized.cache = cache;\n }\n })\n }\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAUA,QAAI,mBAAmB;AAGvB,QAAI,UAAU;AAAd,QACI,UAAU;AADd,QAEI,SAAS;AAGb,QAAI,WAAW;AAYf,aAAS,MAAM,MAAM,SAAS,MAAM;AAClC,cAAQ,KAAK,QAAQ;AAAA,QACnB,KAAK;AAAG,iBAAO,KAAK,KAAK,OAAO;AAAA,QAChC,KAAK;AAAG,iBAAO,KAAK,KAAK,SAAS,KAAK,EAAE;AAAA,QACzC,KAAK;AAAG,iBAAO,KAAK,KAAK,SAAS,KAAK,IAAI,KAAK,EAAE;AAAA,QAClD,KAAK;AAAG,iBAAO,KAAK,KAAK,SAAS,KAAK,IAAI,KAAK,IAAI,KAAK,EAAE;AAAA,MAC7D;AACA,aAAO,KAAK,MAAM,SAAS,IAAI;AAAA,IACjC;AAWA,aAAS,UAAU,GAAG,UAAU;AAC9B,UAAI,QAAQ,IACR,SAAS,MAAM,CAAC;AAEpB,aAAO,EAAE,QAAQ,GAAG;AAClB,eAAO,SAAS,SAAS,KAAK;AAAA,MAChC;AACA,aAAO;AAAA,IACT;AAUA,aAAS,QAAQ,MAAM,WAAW;AAChC,aAAO,SAAS,KAAK;AACnB,eAAO,KAAK,UAAU,GAAG,CAAC;AAAA,MAC5B;AAAA,IACF;AAGA,QAAI,cAAc,OAAO;AAGzB,QAAI,iBAAiB,YAAY;AAOjC,QAAI,iBAAiB,YAAY;AAGjC,QAAI,uBAAuB,YAAY;AAGvC,QAAI,aAAa,QAAQ,OAAO,MAAM,MAAM;AAA5C,QACI,YAAY,KAAK;AAGrB,QAAI,iBAAiB,CAAC,qBAAqB,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
  "name": "overridable-fn",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Simple utility to define functions whose behavior can be overriden at runtime",
5
5
  "author": "Lorefnon <lorefnon@tutanota.com> (https://lorefnon.me)",
6
6
  "main": "index.js",
@@ -16,11 +16,18 @@
16
16
  "type": "module",
17
17
  "license": "MIT",
18
18
  "devDependencies": {
19
+ "lodash.assign": "^4.2.0",
20
+ "lodash.memoize": "^4.1.2",
21
+ "@types/lodash.assign": "^4.2.7",
22
+ "@types/lodash.memoize": "^4.1.7",
19
23
  "@types/node": "^18.11.12",
20
24
  "ts-node": "^10.9.1",
21
25
  "tsup": "^6.5.0",
22
26
  "typescript": "^4.9.4"
23
27
  },
28
+ "dependencies": {
29
+ "@types/lodash": "^4.14.194"
30
+ },
24
31
  "scripts": {
25
32
  "build": "tsup",
26
33
  "test": "ts-node ./test/index.test.ts"