mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-07 04:26:32 +08:00
This updates Rollup, SVGO and clean-css. Only clean-css had reported breaking changes, but we are not affected (Node compatibility removals and changes to features we don't use). R=jacktfranklin@chromium.org Bug: none Change-Id: I94c293e128d1ddb81f12036421a715da210e7633 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3060704 Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
23 lines
692 B
JavaScript
23 lines
692 B
JavaScript
var configuration = require('../../configuration');
|
|
|
|
function isComponentOf(property1, property2, shallow) {
|
|
return isDirectComponentOf(property1, property2) ||
|
|
!shallow && !!configuration[property1.name].shorthandComponents && isSubComponentOf(property1, property2);
|
|
}
|
|
|
|
function isDirectComponentOf(property1, property2) {
|
|
var descriptor = configuration[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;
|