1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
7 | if (k2 === undefined) k2 = k;
|
8 | Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
9 | }) : (function(o, m, k, k2) {
|
10 | if (k2 === undefined) k2 = k;
|
11 | o[k2] = m[k];
|
12 | }));
|
13 | var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14 | Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15 | }) : function(o, v) {
|
16 | o["default"] = v;
|
17 | });
|
18 | var __importStar = (this && this.__importStar) || function (mod) {
|
19 | if (mod && mod.__esModule) return mod;
|
20 | var result = {};
|
21 | if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22 | __setModuleDefault(result, mod);
|
23 | return result;
|
24 | };
|
25 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
26 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
27 | };
|
28 | Object.defineProperty(exports, "__esModule", { value: true });
|
29 | exports.isOneOf = exports.removeNilProperties = exports.deprecate = void 0;
|
30 | const curry_1 = __importDefault(require("lodash/curry"));
|
31 | const isNil_1 = __importDefault(require("lodash/isNil"));
|
32 | const omitBy_1 = __importDefault(require("lodash/omitBy"));
|
33 | const log = __importStar(require("./log"));
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | exports.deprecate = (() => {
|
49 | const warned = new Set();
|
50 | return (name, version, alternative) => {
|
51 | const key = `${name}-${version}`;
|
52 | if (warned.has(key))
|
53 | return;
|
54 | warned.add(key);
|
55 | let message = `${name} is deprecated after version ${version} and will be removed in a future release.`;
|
56 | if (alternative)
|
57 | message += ` Use ${alternative} instead.`;
|
58 | log.warn(message);
|
59 | };
|
60 | })();
|
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 | exports.removeNilProperties = (obj) => omitBy_1.default(obj, isNil_1.default);
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 |
|
78 |
|
79 |
|
80 |
|
81 |
|
82 |
|
83 | exports.isOneOf = curry_1.default((collection, val) => collection.includes(val), 2);
|
84 |
|
\ | No newline at end of file |