{"version":3,"sources":["../../../src/loadDictionaries/loadContentDeclaration.ts"],"sourcesContent":["import { ESMxCJSRequire, loadExternalFile } from '@intlayer/config';\nimport type { Dictionary } from '@intlayer/core';\nimport { processContentDeclaration } from '../transpiler/declaration_file_to_dictionary/intlayer_dictionary/processContentDeclaration';\n\nexport const loadContentDeclarations = async (\n  contentDeclarationFilePath: string[],\n  projectRequire = ESMxCJSRequire\n): Promise<Dictionary[]> => {\n  const contentDeclarations = contentDeclarationFilePath.map((path) => ({\n    ...loadExternalFile(path, undefined, projectRequire),\n    filePath: path,\n  }));\n  const resultDictionariesPaths: Dictionary[] = [];\n\n  for await (const contentDeclaration of contentDeclarations) {\n    if (!contentDeclaration) {\n      continue;\n    }\n\n    const processedContentDeclaration = await processContentDeclaration(\n      contentDeclaration as Dictionary\n    );\n\n    if (!processedContentDeclaration) {\n      continue;\n    }\n\n    resultDictionariesPaths.push(processedContentDeclaration);\n  }\n\n  return resultDictionariesPaths;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAiD;AAEjD,uCAA0C;AAEnC,MAAM,0BAA0B,OACrC,4BACA,iBAAiB,iCACS;AAC1B,QAAM,sBAAsB,2BAA2B,IAAI,CAAC,UAAU;AAAA,IACpE,OAAG,gCAAiB,MAAM,QAAW,cAAc;AAAA,IACnD,UAAU;AAAA,EACZ,EAAE;AACF,QAAM,0BAAwC,CAAC;AAE/C,mBAAiB,sBAAsB,qBAAqB;AAC1D,QAAI,CAAC,oBAAoB;AACvB;AAAA,IACF;AAEA,UAAM,8BAA8B,UAAM;AAAA,MACxC;AAAA,IACF;AAEA,QAAI,CAAC,6BAA6B;AAChC;AAAA,IACF;AAEA,4BAAwB,KAAK,2BAA2B;AAAA,EAC1D;AAEA,SAAO;AACT;","names":[]}