1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.default = void 0;
|
7 |
|
8 | function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableRest(); }
|
9 |
|
10 | function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
11 |
|
12 | function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
13 |
|
14 | function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
15 |
|
16 | function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && Symbol.iterator in Object(iter)) return Array.from(iter); }
|
17 |
|
18 | function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 | var getKey = function getKey(value) {
|
27 | var _value$split$filter = value.split(getKey.regex).filter(Boolean),
|
28 | _value$split$filter2 = _toArray(_value$split$filter),
|
29 | current = _value$split$filter2[0],
|
30 | remaining = _value$split$filter2.slice(1);
|
31 |
|
32 | return [current, remaining.length ? remaining.join('.') : undefined];
|
33 | };
|
34 |
|
35 | getKey.regex = /\.|(\[[^\]]*\])|(\[[-]*\d*\])/;
|
36 | var _default = getKey;
|
37 | exports.default = _default; |
\ | No newline at end of file |