json-machete 0.0.26 → 0.0.28-alpha-74614637f.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 +2 -1
  2. package/index.mjs +2 -1
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -24,6 +24,7 @@ function _interopNamespace(e) {
24
24
  const jsonPtr = require('json-ptr');
25
25
  const utils = require('@graphql-mesh/utils');
26
26
  const path = require('path');
27
+ const util = require('util');
27
28
 
28
29
  (function (OnCircularReference) {
29
30
  OnCircularReference["WARN"] = "WARN";
@@ -313,7 +314,7 @@ async function compareJSONSchemas(oldSchema, newSchema) {
313
314
  const reservedTypeNames = ['Query', 'Mutation', 'Subscription'];
314
315
  function deduplicateJSONSchema(schema, seenMap = new Map()) {
315
316
  if (typeof schema === 'object' && schema != null) {
316
- const stringified = JSON.stringify(schema);
317
+ const stringified = util.inspect(schema, undefined, 3);
317
318
  const seen = seenMap.get(stringified);
318
319
  if (seen) {
319
320
  return seen;
package/index.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { JsonPointer } from 'json-ptr';
2
2
  import { AggregateError } from '@graphql-mesh/utils';
3
3
  import { isAbsolute, join, dirname } from 'path';
4
+ import { inspect } from 'util';
4
5
 
5
6
  var OnCircularReference;
6
7
  (function (OnCircularReference) {
@@ -291,7 +292,7 @@ async function compareJSONSchemas(oldSchema, newSchema) {
291
292
  const reservedTypeNames = ['Query', 'Mutation', 'Subscription'];
292
293
  function deduplicateJSONSchema(schema, seenMap = new Map()) {
293
294
  if (typeof schema === 'object' && schema != null) {
294
- const stringified = JSON.stringify(schema);
295
+ const stringified = inspect(schema, undefined, 3);
295
296
  const seen = seenMap.get(stringified);
296
297
  if (seen) {
297
298
  return seen;
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "json-machete",
3
- "version": "0.0.26",
3
+ "version": "0.0.28-alpha-74614637f.0",
4
4
  "sideEffects": false,
5
5
  "dependencies": {
6
- "@graphql-mesh/utils": "0.21.1",
6
+ "@graphql-mesh/utils": "0.22.0-alpha-74614637f.0",
7
7
  "@json-schema-tools/meta-schema": "1.6.19",
8
8
  "json-ptr": "2.2.0"
9
9
  },