@lucidcms/core
Version:
The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.
1 lines • 1.05 kB
Source Map (JSON)
{"version":3,"file":"options.mjs","names":["formatter"],"sources":["../../../src/libs/formatters/options.ts"],"sourcesContent":["import type { Option } from \"../../types/response.js\";\nimport type { LucidOptions, Select } from \"../db/types.js\";\nimport formatter from \"./index.js\";\n\nconst formatMultiple = (props: {\n\toptions: Select<LucidOptions>[];\n}): Option[] => {\n\treturn props.options.map((o) => formatSingle({ option: o }));\n};\n\nconst formatSingle = (props: { option: Select<LucidOptions> }): Option => {\n\treturn {\n\t\tname: props.option.name as Option[\"name\"],\n\t\tvalueText: props.option.value_text,\n\t\tvalueInt: props.option.value_int,\n\t\tvalueBool: formatter.formatBoolean(props.option.value_bool),\n\t};\n};\n\nexport default {\n\tformatMultiple,\n\tformatSingle,\n};\n"],"mappings":"2BAIA,MAAM,EAAkB,GAGhB,EAAM,QAAQ,IAAK,GAAM,EAAa,CAAE,OAAQ,CAAE,CAAC,CAAC,EAGtD,EAAgB,IACd,CACN,KAAM,EAAM,OAAO,KACnB,UAAW,EAAM,OAAO,WACxB,SAAU,EAAM,OAAO,UACvB,UAAWA,EAAU,cAAc,EAAM,OAAO,UAAU,CAC3D,GAGD,IAAA,EAAe,CACd,iBACA,cACD"}