lingo.dev 0.117.9 → 0.117.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cli.mjs CHANGED
@@ -4146,6 +4146,9 @@ function createMjmlLoader() {
4146
4146
  return createLoader({
4147
4147
  async pull(locale, input2) {
4148
4148
  const result = {};
4149
+ if (!input2 || input2.trim() === "") {
4150
+ return result;
4151
+ }
4149
4152
  try {
4150
4153
  const parsed = await parseStringPromise3(input2, {
4151
4154
  explicitArray: true,
@@ -4192,8 +4195,11 @@ function createMjmlLoader() {
4192
4195
  return result;
4193
4196
  },
4194
4197
  async push(locale, data, originalInput) {
4198
+ if (!originalInput || originalInput.trim() === "") {
4199
+ return originalInput || "";
4200
+ }
4195
4201
  try {
4196
- const parsed = await parseStringPromise3(originalInput || "", {
4202
+ const parsed = await parseStringPromise3(originalInput, {
4197
4203
  explicitArray: true,
4198
4204
  explicitChildren: true,
4199
4205
  preserveChildrenOrder: true,
@@ -4335,11 +4341,10 @@ function convertDomToXmlNode(domNode) {
4335
4341
  return null;
4336
4342
  }
4337
4343
  function serializeMjml(parsed) {
4338
- const xmlDec = '<?xml version="1.0" encoding="UTF-8"?>\n';
4339
4344
  const rootKey = Object.keys(parsed).find((key) => !key.startsWith("_") && !key.startsWith("$"));
4340
4345
  const rootNode = rootKey ? parsed[rootKey] : parsed;
4341
4346
  const body = serializeElement2(rootNode);
4342
- return xmlDec + body;
4347
+ return body;
4343
4348
  }
4344
4349
  function serializeElement2(node, indent2 = "") {
4345
4350
  if (!node) {
@@ -14595,7 +14600,7 @@ async function renderHero2() {
14595
14600
  // package.json
14596
14601
  var package_default = {
14597
14602
  name: "lingo.dev",
14598
- version: "0.117.9",
14603
+ version: "0.117.10",
14599
14604
  description: "Lingo.dev CLI",
14600
14605
  private: false,
14601
14606
  publishConfig: {