lingo.dev 0.78.5 → 0.78.6

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.cjs CHANGED
@@ -1219,13 +1219,41 @@ function createYamlLoader() {
1219
1219
  async pull(locale, input2) {
1220
1220
  return _yaml2.default.parse(input2) || {};
1221
1221
  },
1222
- async push(locale, payload) {
1222
+ async push(locale, payload, originalInput) {
1223
1223
  return _yaml2.default.stringify(payload, {
1224
- lineWidth: -1
1224
+ lineWidth: -1,
1225
+ defaultKeyType: getKeyType(originalInput),
1226
+ defaultStringType: getStringType(originalInput)
1225
1227
  });
1226
1228
  }
1227
1229
  });
1228
1230
  }
1231
+ function getKeyType(yamlString) {
1232
+ if (yamlString) {
1233
+ const lines = yamlString.split("\n");
1234
+ const hasDoubleQuotes = lines.find((line) => {
1235
+ return line.trim().startsWith('"') && line.trim().match('":');
1236
+ });
1237
+ if (hasDoubleQuotes) {
1238
+ return "QUOTE_DOUBLE";
1239
+ }
1240
+ }
1241
+ return "PLAIN";
1242
+ }
1243
+ function getStringType(yamlString) {
1244
+ if (yamlString) {
1245
+ const lines = yamlString.split("\n");
1246
+ const hasDoubleQuotes = lines.find((line) => {
1247
+ const trimmedLine = line.trim();
1248
+ return (trimmedLine.startsWith('"') || trimmedLine.match(/:\s*"/)) && (trimmedLine.endsWith('"') || trimmedLine.endsWith('",'));
1249
+ });
1250
+ console.log("hasDoubleQuotes", hasDoubleQuotes);
1251
+ if (hasDoubleQuotes) {
1252
+ return "QUOTE_DOUBLE";
1253
+ }
1254
+ }
1255
+ return "PLAIN";
1256
+ }
1229
1257
 
1230
1258
  // src/cli/loaders/root-key.ts
1231
1259
  function createRootKeyLoader(replaceAll = false) {
@@ -3868,7 +3896,7 @@ var mcp_default = new (0, _interactivecommander.Command)().command("mcp").descri
3868
3896
  // package.json
3869
3897
  var package_default = {
3870
3898
  name: "lingo.dev",
3871
- version: "0.78.5",
3899
+ version: "0.78.6",
3872
3900
  description: "Lingo.dev CLI",
3873
3901
  private: false,
3874
3902
  publishConfig: {