@intlayer/chokidar 7.3.12 → 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.
@@ -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;