1 | 'use strict';
|
2 |
|
3 | Object.defineProperty(exports, "__esModule", {
|
4 | value: true
|
5 | });
|
6 |
|
7 | var _lodash = require('lodash');
|
8 |
|
9 | var _lodash2 = _interopRequireDefault(_lodash);
|
10 |
|
11 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
12 |
|
13 | var styleNameIndex = {};
|
14 |
|
15 | exports.default = function (styleNamePropertyValue, allowMultiple) {
|
16 | var styleNames = void 0;
|
17 |
|
18 | if (styleNameIndex[styleNamePropertyValue]) {
|
19 | styleNames = styleNameIndex[styleNamePropertyValue];
|
20 | } else {
|
21 | styleNames = _lodash2.default.trim(styleNamePropertyValue).split(' ');
|
22 | styleNames = _lodash2.default.filter(styleNames);
|
23 |
|
24 | styleNameIndex[styleNamePropertyValue] = styleNames;
|
25 | }
|
26 |
|
27 | if (allowMultiple === false && styleNames.length > 1) {
|
28 | throw new Error('ReactElement styleName property defines multiple module names ("' + styleNamePropertyValue + '").');
|
29 | }
|
30 |
|
31 | return styleNames;
|
32 | };
|
33 |
|
34 | module.exports = exports['default']; |
\ | No newline at end of file |