| 17 | > { |
| 18 | return createLoader({ |
| 19 | async pull(locale, input) { |
| 20 | try { |
| 21 | const parsed = plist.parse(input || emptyData); |
| 22 | if (typeof parsed !== "object" || parsed === null) { |
| 23 | throw new CLIError({ |
| 24 | message: "Invalid .stringsdict format", |
| 25 | docUrl: "invalidStringDict", |
| 26 | }); |
| 27 | } |
| 28 | return parsed as Record<string, any>; |
| 29 | } catch (error: any) { |
| 30 | throw new CLIError({ |
| 31 | message: `Invalid .stringsdict format: ${error.message}`, |
| 32 | docUrl: "invalidStringDict", |
| 33 | }); |
| 34 | } |
| 35 | }, |
| 36 | async push(locale, payload) { |
| 37 | const plistContent = plist.build(payload); |
| 38 | return plistContent; |