Release v0.1.16
This commit is contained in:
@@ -521,11 +521,32 @@ function inspectSource(repository, sourceRoot, sourcePath) {
|
||||
) {
|
||||
return propertyNameText(current.name);
|
||||
}
|
||||
if (
|
||||
ts.isVariableDeclaration(current) &&
|
||||
ts.isIdentifier(current.name) &&
|
||||
(current.name.text === "en" || current.name.text === "de") &&
|
||||
current.initializer &&
|
||||
isCatalogObject(current.initializer)
|
||||
) {
|
||||
return current.name.text;
|
||||
}
|
||||
current = current.parent;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function isCatalogObject(node) {
|
||||
let current = node;
|
||||
while (
|
||||
ts.isAsExpression(current) ||
|
||||
ts.isSatisfiesExpression(current) ||
|
||||
ts.isParenthesizedExpression(current)
|
||||
) {
|
||||
current = current.expression;
|
||||
}
|
||||
return ts.isObjectLiteralExpression(current);
|
||||
}
|
||||
|
||||
function ancestorPropertyName(node, expected) {
|
||||
let current = node.parent;
|
||||
while (current) {
|
||||
|
||||
Reference in New Issue
Block a user