()
| 3 | import { createLoader } from "./_utils"; |
| 4 | |
| 5 | export default function createJson5Loader(): ILoader< |
| 6 | string, |
| 7 | Record<string, any> |
| 8 | > { |
| 9 | return createLoader({ |
| 10 | pull: async (locale, input) => { |
| 11 | const json5String = input || "{}"; |
| 12 | return JSON5.parse(json5String); |
| 13 | }, |
| 14 | push: async (locale, data) => { |
| 15 | const serializedData = JSON5.stringify(data, null, 2); |
| 16 | return serializedData; |
| 17 | }, |
| 18 | }); |
| 19 | } |
no test coverage detected