Last change
on this file since 59329aa was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.default = void 0;
|
---|
7 |
|
---|
8 | var _isCustomProp = _interopRequireDefault(require("./isCustomProp"));
|
---|
9 |
|
---|
10 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
---|
11 |
|
---|
12 | const important = node => node.important;
|
---|
13 |
|
---|
14 | const unimportant = node => !node.important;
|
---|
15 |
|
---|
16 | const hasInherit = node => node.value.toLowerCase() === 'inherit';
|
---|
17 |
|
---|
18 | const hasInitial = node => node.value.toLowerCase() === 'initial';
|
---|
19 |
|
---|
20 | const hasUnset = node => node.value.toLowerCase() === 'unset';
|
---|
21 |
|
---|
22 | var _default = (props, includeCustomProps = true) => {
|
---|
23 | if (props.some(hasInherit) && !props.every(hasInherit)) {
|
---|
24 | return false;
|
---|
25 | }
|
---|
26 |
|
---|
27 | if (props.some(hasInitial) && !props.every(hasInitial)) {
|
---|
28 | return false;
|
---|
29 | }
|
---|
30 |
|
---|
31 | if (props.some(hasUnset) && !props.every(hasUnset)) {
|
---|
32 | return false;
|
---|
33 | }
|
---|
34 |
|
---|
35 | if (includeCustomProps && props.some(_isCustomProp.default) && !props.every(_isCustomProp.default)) {
|
---|
36 | return false;
|
---|
37 | }
|
---|
38 |
|
---|
39 | return props.every(unimportant) || props.every(important);
|
---|
40 | };
|
---|
41 |
|
---|
42 | exports.default = _default;
|
---|
43 | module.exports = exports.default; |
---|
Note:
See
TracBrowser
for help on using the repository browser.