Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_scopedComponentNames(name, scope) {
const closestRelativeName = [].concat(this.muScopedComponents, this.currentRouteComponents())
.filter((resolvedName)=>resolvedName.endsWith(name)).pop();
// closestRelativeName can be undefined
if (!scope) {
return [closestRelativeName, name];
}
const normalizedContext = componentNameFromClassName(scope.constructor.name);
const candidate = normalizedContext + '/' + name;
const result = [];
if (typeof closestRelativeName === 'string') {
result.push(closestRelativeName);
}
if (candidate !== 'class/' + name) {
if (!result.includes(candidate)) {
result.push(candidate);
}
}
// todo add hotReloadCUSTOMhlContext... to resolve deep nesting
const namesFromContext = this.extractNamesFromContext(scope).reverse();
for (let i = 1; i <= namesFromContext.length; i++) {
const possibleNamePaths = namesFromContext.slice(0, i);
possibleNamePaths.push(name);
result.push(possibleNamePaths.join('/'));