@intlayer/core
Version:
Includes core Intlayer functions like translation, dictionary, and utility functions shared across multiple packages.
27 lines (25 loc) • 644 B
JavaScript
import { NodeType, formatNodeType } from "@intlayer/types";
//#region src/transpiler/enumeration/enumeration.ts
/**
* Function intended to be used to build intlayer dictionaries.
*
* Allow to pick a content based on a quantity.
*
* Usage:
*
* ```ts
* enu({
* '<=-2.3': 'You have less than -2.3',
* '<1': 'You have less than one',
* '2': 'You have two',
* '>=3': 'You have three or more',
* });
* ```
*
* > The order of the keys will define the priority of the content.
*
*/
const enumeration = (content) => formatNodeType(NodeType.Enumeration, content);
//#endregion
export { enumeration as enu };
//# sourceMappingURL=enumeration.mjs.map