@intlayer/core
Version:
Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.
25 lines (23 loc) • 580 B
JavaScript
import { NodeType, formatNodeType } from "@intlayer/types";
//#region src/transpiler/condition/condition.ts
/**
* Function intended to be used to build intlayer dictionaries.
*
* Allow to pick a content based on a condition.
*
* Usage:
*
* ```ts
* cond({
* 'true': 'The condition is validated',
* 'false': 'The condition is not validated',
* });
* ```
*
* The last key provided will be used as the fallback value.
*
*/
const condition = (content) => formatNodeType(NodeType.Condition, content);
//#endregion
export { condition as cond };
//# sourceMappingURL=condition.mjs.map