@intlayer/chokidar 7.3.11 → 7.3.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs +7 -0
- package/dist/cjs/writeContentDeclaration/transformJSFile.cjs.map +1 -1
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs +7 -0
- package/dist/esm/writeContentDeclaration/transformJSFile.mjs.map +1 -1
- package/dist/types/buildIntlayerDictionary/buildIntlayerDictionary.d.ts +2 -2
- package/dist/types/buildIntlayerDictionary/writeFetchDictionary.d.ts +3 -3
- package/dist/types/buildIntlayerDictionary/writeMergedDictionary.d.ts +2 -2
- package/dist/types/buildIntlayerDictionary/writeRemoteDictionary.d.ts +2 -2
- package/dist/types/createDictionaryEntryPoint/createDictionaryEntryPoint.d.ts +2 -2
- package/dist/types/createDictionaryEntryPoint/generateDictionaryListContent.d.ts +2 -2
- package/dist/types/loadDictionaries/loadRemoteDictionaries.d.ts +2 -2
- package/package.json +11 -11
|
@@ -1718,9 +1718,12 @@ const transformJSFile = async (fileContent, dictionary, fallbackLocale) => {
|
|
|
1718
1718
|
const contentProperty = rootObject.getProperty("content");
|
|
1719
1719
|
let contentObject;
|
|
1720
1720
|
let isContentArrayInSource = false;
|
|
1721
|
+
let isContentCallExpression = false;
|
|
1721
1722
|
if (contentProperty && ts_morph.Node.isPropertyAssignment(contentProperty)) {
|
|
1722
1723
|
contentObject = contentProperty.getInitializerIfKind(ts_morph.SyntaxKind.ObjectLiteralExpression);
|
|
1723
1724
|
isContentArrayInSource = !!contentProperty.getInitializerIfKind(ts_morph.SyntaxKind.ArrayLiteralExpression);
|
|
1725
|
+
const initializer = contentProperty.getInitializer();
|
|
1726
|
+
isContentCallExpression = !!initializer && ts_morph.Node.isCallExpression(initializer);
|
|
1724
1727
|
}
|
|
1725
1728
|
const effectiveFallbackLocale = fallbackLocale ?? "en";
|
|
1726
1729
|
if (contentObject && !Array.isArray(dictionary.content)) {
|
|
@@ -1728,6 +1731,10 @@ const transformJSFile = async (fileContent, dictionary, fallbackLocale) => {
|
|
|
1728
1731
|
if (processContentEntries(contentObject, dictContent, effectiveFallbackLocale, requiredImports, sourceFile)) changed = true;
|
|
1729
1732
|
} else if (Array.isArray(dictionary.content) && isContentArrayInSource) {
|
|
1730
1733
|
if (processArrayContent(rootObject, "content", dictionary.content ?? [], getExistingPropertyNames(rootObject), effectiveFallbackLocale, requiredImports, sourceFile)) changed = true;
|
|
1734
|
+
} else if (isContentCallExpression) {
|
|
1735
|
+
if ((0, __intlayer_core.getNodeType)(dictionary.content)) {
|
|
1736
|
+
if (processComplexContent(rootObject, "content", dictionary.content, getExistingPropertyNames(rootObject), effectiveFallbackLocale, requiredImports, sourceFile)) changed = true;
|
|
1737
|
+
}
|
|
1731
1738
|
}
|
|
1732
1739
|
}
|
|
1733
1740
|
if (!changed) return fileContent;
|