1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.intersect_ = exports.memoize = void 0;
|
4 |
|
5 |
|
6 |
|
7 | function memoize(f) {
|
8 | var cache = new Map();
|
9 | return function (a) {
|
10 | if (!cache.has(a)) {
|
11 | var b = f(a);
|
12 | cache.set(a, b);
|
13 | return b;
|
14 | }
|
15 | return cache.get(a);
|
16 | };
|
17 | }
|
18 | exports.memoize = memoize;
|
19 |
|
20 |
|
21 |
|
22 | var typeOf = function (x) { return (x === null ? 'null' : typeof x); };
|
23 |
|
24 |
|
25 |
|
26 | var intersect_ = function (a, b) {
|
27 | if (a !== undefined && b !== undefined) {
|
28 | var tx = typeOf(a);
|
29 | var ty = typeOf(b);
|
30 | if (tx === 'object' || ty === 'object') {
|
31 | return Object.assign({}, a, b);
|
32 | }
|
33 | }
|
34 | return b;
|
35 | };
|
36 | exports.intersect_ = intersect_;
|