1 | "use strict";
|
2 |
|
3 | exports.__esModule = true;
|
4 | exports["default"] = void 0;
|
5 | var _errors = _interopRequireDefault(require("./_errors"));
|
6 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
7 | function generateSelectors(template, state) {
|
8 | var stateSuffix = state ? ":" + state : '';
|
9 | return template(stateSuffix);
|
10 | }
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | function statefulSelectors(states, template, stateMap) {
|
17 | if (!template) throw new _errors["default"](67);
|
18 | if (states.length === 0) return generateSelectors(template, null);
|
19 | var selectors = [];
|
20 | for (var i = 0; i < states.length; i += 1) {
|
21 | if (stateMap && stateMap.indexOf(states[i]) < 0) {
|
22 | throw new _errors["default"](68);
|
23 | }
|
24 | selectors.push(generateSelectors(template, states[i]));
|
25 | }
|
26 | selectors = selectors.join(',');
|
27 | return selectors;
|
28 | }
|
29 | var _default = exports["default"] = statefulSelectors;
|
30 | module.exports = exports.default; |
\ | No newline at end of file |