UNPKG

@lucidcms/core

Version:

The core of the Lucid CMS. It's responsible for spinning up the API and serving the CMS.

1 lines 1.22 kB
{"version":3,"file":"license.mjs","names":["formatter"],"sources":["../../../src/libs/formatters/license.ts"],"sourcesContent":["import type { License } from \"../../types/response.js\";\nimport type { BooleanInt } from \"../../types.js\";\nimport { createLicenseKeyDisplay } from \"../../utils/helpers/license-key-display.js\";\nimport formatter from \"./index.js\";\n\ninterface LicensePropsT {\n\tkey: string | null;\n\tvalid: BooleanInt;\n\tlastChecked: number | null;\n\terrorMessage: string | null;\n\taiEnabled: BooleanInt;\n}\n\nconst formatSingle = (props: { license: LicensePropsT }): License => {\n\treturn {\n\t\tkey: createLicenseKeyDisplay(props.license.key),\n\t\tvalid: formatter.formatBoolean(props.license.valid),\n\t\tlastChecked: props.license.lastChecked,\n\t\terrorMessage: props.license.errorMessage,\n\t\tai: {\n\t\t\tenabled: formatter.formatBoolean(props.license.aiEnabled),\n\t\t},\n\t};\n};\n\nexport default {\n\tformatSingle,\n\tcreateLicenseKeyDisplay,\n};\n"],"mappings":"iHAyBA,IAAA,EAAe,CACd,aAbqB,IACd,CACN,IAAK,EAAwB,EAAM,QAAQ,GAAG,EAC9C,MAAOA,EAAU,cAAc,EAAM,QAAQ,KAAK,EAClD,YAAa,EAAM,QAAQ,YAC3B,aAAc,EAAM,QAAQ,aAC5B,GAAI,CACH,QAASA,EAAU,cAAc,EAAM,QAAQ,SAAS,CACzD,CACD,GAKA,yBACD"}