{"version":3,"sources":["../../../src/interpreter/getDictionary.ts"],"sourcesContent":["import type { Locales, LocalesValues } from '@intlayer/config/client';\nimport type { Dictionary } from '../types';\nimport type { Plugins, NodeProps, DeepTransformContent } from './getContent';\nimport { getContent } from './getContent/getContent';\n\n/**\n * Transforms a dictionary in a single pass, applying each plugin as needed.\n *\n * @param dictionary The dictionary to transform.\n * @param locale The locale to use if your transformers need it (e.g. for translations).\n * @param additionalPlugins An array of NodeTransformer that define how to transform recognized nodes.\n *                      If omitted, we’ll use a default set of plugins.\n */\nexport const getDictionary = <\n  T extends Dictionary,\n  L extends LocalesValues = Locales,\n>(\n  dictionary: T,\n  locale?: L,\n  plugins?: Plugins[]\n) => {\n  const props: NodeProps = {\n    dictionaryKey: dictionary.key,\n    dictionaryPath: dictionary.filePath,\n    keyPath: [],\n    plugins,\n  };\n\n  // @ts-ignore Type instantiation is excessively deep and possibly infinite\n  return getContent(\n    dictionary.content,\n    props,\n    locale\n  ) as any as DeepTransformContent<T['content']>;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,wBAA2B;AAUpB,MAAM,gBAAgB,CAI3B,YACA,QACA,YACG;AACH,QAAM,QAAmB;AAAA,IACvB,eAAe,WAAW;AAAA,IAC1B,gBAAgB,WAAW;AAAA,IAC3B,SAAS,CAAC;AAAA,IACV;AAAA,EACF;AAGA,aAAO;AAAA,IACL,WAAW;AAAA,IACX;AAAA,IACA;AAAA,EACF;AACF;","names":[]}