@easy-breezy/generator-api
Advanced tools
Comparing version 2.0.33 to 2.0.34
@@ -72,9 +72,9 @@ import { dirname, join, relative } from 'path'; | ||
schemaStringify = (payload) => { | ||
const cache = []; | ||
return JSON.stringify(payload, (key, value) => { | ||
if (key === 'x-marker') { | ||
return; | ||
} | ||
if (typeof value === 'object' && value !== null) { | ||
if (cache.includes(value)) { | ||
const ensureProperties = (obj) => { | ||
const seen = []; | ||
const visit = (value) => { | ||
if (value === null || typeof value !== 'object') { | ||
return value; | ||
} | ||
if (seen.indexOf(value) !== -1) { | ||
return { | ||
@@ -84,3 +84,21 @@ type: 'null' | ||
} | ||
cache.push(value); | ||
seen.push(value); | ||
if (Array.isArray(value)) { | ||
const result = value.map(visit); | ||
seen.pop(); | ||
return result; | ||
} | ||
const result = Object.keys(value).reduce((acc, key) => { | ||
// @ts-ignore | ||
acc[key] = visit(value[key]); | ||
return acc; | ||
}, {}); | ||
seen.pop(); | ||
return result; | ||
}; | ||
return visit(obj); | ||
}; | ||
return JSON.stringify(ensureProperties(payload), (key, value) => { | ||
if (key === 'x-marker') { | ||
return; | ||
} | ||
@@ -300,2 +318,3 @@ return value; | ||
}, {}); | ||
// console.log(123, collector['/api/issue/issue/'].get.responses['200'].properties.results.items.properties.client_user) | ||
this.normalizeJSON(collector); | ||
@@ -302,0 +321,0 @@ const pathAPI = this.path(this.answers.dir, this.answers.name); |
{ | ||
"name": "@easy-breezy/generator-api", | ||
"version": "2.0.33", | ||
"version": "2.0.34", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "type": "module", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
70287
1148