Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private _resolve(defs: Definition[] = [], qualifiedID: string): Definition | undefined {
const qualifiedIDParts = qualifiedID.split(".");
const base = qualifiedIDParts.shift();
const retVal = find(defs, def => {
if (typeof def.name === "string" && typeof base === "string" && def.name.toLowerCase() === base.toLowerCase()) {
return true;
}
return false;
});
if (retVal && retVal.definitions.length && qualifiedIDParts.length) {
return this._resolve(retVal.definitions, qualifiedIDParts.join("."));
}
return retVal;
}