{"version":3,"file":"condition.mjs","names":[],"sources":["../../../../src/transpiler/condition/condition.ts"],"sourcesContent":["import type { TypedNodeModel } from '@intlayer/types/nodeType';\nimport { CONDITION, formatNodeType } from '@intlayer/types/nodeType';\n\nexport type ConditionContentStates<Content> = Record<`${boolean}`, Content> & {\n  fallback?: Content;\n};\n\nexport type ConditionContent<Content = unknown> = TypedNodeModel<\n  typeof CONDITION,\n  ConditionContentStates<Content>\n>;\n\n/**\n * Function intended to be used to build intlayer dictionaries.\n *\n * Allow to pick a content based on a condition.\n *\n * Usage:\n *\n * ```ts\n * cond({\n *  'true': 'The condition is validated',\n *  'false': 'The condition is not validated',\n * });\n * ```\n *\n * The last key provided will be used as the fallback value.\n *\n */\nconst condition = <Content>(\n  content?: ConditionContentStates<Content>\n): ConditionContent<Content> => formatNodeType(CONDITION, content);\n\nexport { condition as cond };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,aACJ,YAC8B,eAAe,WAAW,QAAQ"}