json-machete 0.4.3 → 0.5.0

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.
Files changed (3) hide show
  1. package/index.js +6 -2
  2. package/index.mjs +6 -2
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -445,7 +445,8 @@ async function dereferenceObject(obj, { cwd = process.cwd(), externalFileCache =
445
445
  }
446
446
  }
447
447
  else {
448
- await Promise.all(Object.entries(obj).map(async ([key, val]) => {
448
+ for (const key in obj) {
449
+ const val = obj[key];
449
450
  if (typeof val === 'object') {
450
451
  obj[key] = await dereferenceObject(val, {
451
452
  cwd,
@@ -456,7 +457,7 @@ async function dereferenceObject(obj, { cwd = process.cwd(), externalFileCache =
456
457
  headers,
457
458
  });
458
459
  }
459
- }));
460
+ }
460
461
  }
461
462
  }
462
463
  return obj;
@@ -611,6 +612,9 @@ async function healJSONSchema(schema) {
611
612
  pathBasedName += '_';
612
613
  }
613
614
  }
615
+ if (subSchema.description != null) {
616
+ subSchema.description = subSchema.description.trim();
617
+ }
614
618
  }
615
619
  return subSchema;
616
620
  }, {
package/index.mjs CHANGED
@@ -440,7 +440,8 @@ async function dereferenceObject(obj, { cwd = process.cwd(), externalFileCache =
440
440
  }
441
441
  }
442
442
  else {
443
- await Promise.all(Object.entries(obj).map(async ([key, val]) => {
443
+ for (const key in obj) {
444
+ const val = obj[key];
444
445
  if (typeof val === 'object') {
445
446
  obj[key] = await dereferenceObject(val, {
446
447
  cwd,
@@ -451,7 +452,7 @@ async function dereferenceObject(obj, { cwd = process.cwd(), externalFileCache =
451
452
  headers,
452
453
  });
453
454
  }
454
- }));
455
+ }
455
456
  }
456
457
  }
457
458
  return obj;
@@ -606,6 +607,9 @@ async function healJSONSchema(schema) {
606
607
  pathBasedName += '_';
607
608
  }
608
609
  }
610
+ if (subSchema.description != null) {
611
+ subSchema.description = subSchema.description.trim();
612
+ }
609
613
  }
610
614
  return subSchema;
611
615
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "json-machete",
3
- "version": "0.4.3",
3
+ "version": "0.5.0",
4
4
  "sideEffects": false,
5
5
  "dependencies": {
6
6
  "@graphql-mesh/utils": "0.27.0",