source: trip-planner-front/node_modules/postcss-merge-longhand/dist/lib/canMerge.js@ fa375fe

Last change on this file since fa375fe 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
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.default = void 0;
7
8var _isCustomProp = _interopRequireDefault(require("./isCustomProp"));
9
10function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
12const important = node => node.important;
13
14const unimportant = node => !node.important;
15
16const hasInherit = node => node.value.toLowerCase() === 'inherit';
17
18const hasInitial = node => node.value.toLowerCase() === 'initial';
19
20const hasUnset = node => node.value.toLowerCase() === 'unset';
21
22var _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
42exports.default = _default;
43module.exports = exports.default;
Note: See TracBrowser for help on using the repository browser.