1 | "use strict";
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 | exports.splitByPlaceholders = exports.makePlaceholder = exports.placeholderRegex = void 0;
|
7 |
|
8 | function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }
|
9 |
|
10 | function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance"); }
|
11 |
|
12 | function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }
|
13 |
|
14 | function _toArray(arr) { return _arrayWithHoles(arr) || _iterableToArray(arr) || _nonIterableRest(); }
|
15 |
|
16 | function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance"); }
|
17 |
|
18 | function _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter); }
|
19 |
|
20 | function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
21 |
|
22 |
|
23 | var placeholderRegex = /(?:__PLACEHOLDER_(\d+)__)/g;
|
24 |
|
25 | exports.placeholderRegex = placeholderRegex;
|
26 | var placeholderNonCapturingRegex = /__PLACEHOLDER_(?:\d+)__/g;
|
27 |
|
28 | var makePlaceholder = function makePlaceholder(index) {
|
29 | return `__PLACEHOLDER_${index}__`;
|
30 | };
|
31 |
|
32 |
|
33 | exports.makePlaceholder = makePlaceholder;
|
34 |
|
35 | var splitByPlaceholders = function splitByPlaceholders(_ref) {
|
36 | var _ref2 = _toArray(_ref),
|
37 | css = _ref2[0],
|
38 | rest = _ref2.slice(1);
|
39 |
|
40 | var capture = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
41 | return [css.split(capture ? placeholderRegex : placeholderNonCapturingRegex)].concat(_toConsumableArray(rest));
|
42 | };
|
43 |
|
44 | exports.splitByPlaceholders = splitByPlaceholders; |
\ | No newline at end of file |