1 | ;
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | const Switch = exports.Switch = (patterns, protector = e => e) => (matches, mProtector = e => e) => (...data) => {
|
7 | const keyList = Object.keys(patterns);
|
8 | const normalized = protector(...data);
|
9 | for (const key of keyList) if (patterns[key](normalized)) return mProtector(matches[key]);
|
10 | };
|
11 |
|
12 | exports.default = Switch;
|
13 | //# sourceMappingURL=switch.js.map |
\ | No newline at end of file |