@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.
@@ -1717,9 +1717,12 @@ const transformJSFile = async (fileContent, dictionary, fallbackLocale) => {
1717
1717
  const contentProperty = rootObject.getProperty("content");
1718
1718
  let contentObject;
1719
1719
  let isContentArrayInSource = false;
1720
+ let isContentCallExpression = false;
1720
1721
  if (contentProperty && Node.isPropertyAssignment(contentProperty)) {
1721
1722
  contentObject = contentProperty.getInitializerIfKind(SyntaxKind.ObjectLiteralExpression);
1722
1723
  isContentArrayInSource = !!contentProperty.getInitializerIfKind(SyntaxKind.ArrayLiteralExpression);
1724
+ const initializer = contentProperty.getInitializer();
1725
+ isContentCallExpression = !!initializer && Node.isCallExpression(initializer);
1723
1726
  }
1724
1727
  const effectiveFallbackLocale = fallbackLocale ?? "en";
1725
1728
  if (contentObject && !Array.isArray(dictionary.content)) {
@@ -1727,6 +1730,10 @@ const transformJSFile = async (fileContent, dictionary, fallbackLocale) => {
1727
1730
  if (processContentEntries(contentObject, dictContent, effectiveFallbackLocale, requiredImports, sourceFile)) changed = true;
1728
1731
  } else if (Array.isArray(dictionary.content) && isContentArrayInSource) {
1729
1732
  if (processArrayContent(rootObject, "content", dictionary.content ?? [], getExistingPropertyNames(rootObject), effectiveFallbackLocale, requiredImports, sourceFile)) changed = true;
1733
+ } else if (isContentCallExpression) {
1734
+ if (getNodeType(dictionary.content)) {
1735
+ if (processComplexContent(rootObject, "content", dictionary.content, getExistingPropertyNames(rootObject), effectiveFallbackLocale, requiredImports, sourceFile)) changed = true;
1736
+ }
1730
1737
  }
1731
1738
  }
1732
1739
  if (!changed) return fileContent;