First support for md extensions; Package all needed dependencies in the repo

This commit is contained in:
2022-06-24 00:30:50 +02:00
parent 543e3de13e
commit cd5b7d6100
3582 changed files with 223035 additions and 48 deletions

View File

@ -0,0 +1,22 @@
var compactable = require('../compactable');
function isComponentOf(property1, property2, shallow) {
return isDirectComponentOf(property1, property2) ||
!shallow && !!compactable[property1.name].shorthandComponents && isSubComponentOf(property1, property2);
}
function isDirectComponentOf(property1, property2) {
var descriptor = compactable[property1.name];
return 'components' in descriptor && descriptor.components.indexOf(property2.name) > -1;
}
function isSubComponentOf(property1, property2) {
return property1
.components
.some(function (component) {
return isDirectComponentOf(component, property2);
});
}
module.exports = isComponentOf;