source: imaps-frontend/node_modules/clean-css/lib/optimizer/level-2/properties/is-component-of.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 691 bytes
Line 
1var configuration = require('../../configuration');
2
3function isComponentOf(property1, property2, shallow) {
4 return isDirectComponentOf(property1, property2)
5 || !shallow && !!configuration[property1.name].shorthandComponents && isSubComponentOf(property1, property2);
6}
7
8function isDirectComponentOf(property1, property2) {
9 var descriptor = configuration[property1.name];
10
11 return 'components' in descriptor && descriptor.components.indexOf(property2.name) > -1;
12}
13
14function isSubComponentOf(property1, property2) {
15 return property1
16 .components
17 .some(function(component) {
18 return isDirectComponentOf(component, property2);
19 });
20}
21
22module.exports = isComponentOf;
Note: See TracBrowser for help on using the repository browser.