UNPKG

@magidoc/plugin-starter-variables

Version:

A shared library that contains common Magidoc starter environment variables keys.

23 lines (21 loc) 656 B
function recordConverter(valueType) { return { convert: (target) => { if (typeof target === 'object') { return target; } if (typeof target === 'string') { const result = JSON.parse(target); if (typeof result !== 'object') { return null; } return result; } return null; }, asString: (value) => JSON.stringify(value), type: (z) => z.record(z.string(), valueType(z).optional()).optional(), }; } export { recordConverter }; //# sourceMappingURL=record.js.map