typescript-json-schema
Advanced tools
Comparing version 0.51.0 to 0.52.0
@@ -7,3 +7,3 @@ "use strict"; | ||
var helpText = "Usage: typescript-json-schema <path-to-typescript-files-or-tsconfig> <type>"; | ||
var defaultArgs = typescript_json_schema_1.getDefaultArgs(); | ||
var defaultArgs = (0, typescript_json_schema_1.getDefaultArgs)(); | ||
var args = require("yargs") | ||
@@ -56,3 +56,3 @@ .usage(helpText) | ||
.argv; | ||
typescript_json_schema_1.exec(args._[0], args._[1], { | ||
(0, typescript_json_schema_1.exec)(args._[0], args._[1], { | ||
ref: args.refs, | ||
@@ -59,0 +59,0 @@ aliasRef: args.aliasRefs, |
@@ -52,3 +52,3 @@ "use strict"; | ||
var glob = require("glob"); | ||
var stringify = require("json-stable-stringify"); | ||
var safe_stable_stringify_1 = require("safe-stable-stringify"); | ||
var path = require("path"); | ||
@@ -251,9 +251,11 @@ var crypto_1 = require("crypto"); | ||
function getCanonicalDeclaration(sym) { | ||
var _a, _b, _c; | ||
if (sym.valueDeclaration !== undefined) { | ||
return sym.valueDeclaration; | ||
} | ||
else if (sym.declarations.length === 1) { | ||
else if (((_a = sym.declarations) === null || _a === void 0 ? void 0 : _a.length) === 1) { | ||
return sym.declarations[0]; | ||
} | ||
throw new Error("Symbol \"" + sym.name + "\" has no valueDeclaration and " + sym.declarations.length + " declarations."); | ||
var declarationCount = (_c = (_b = sym.declarations) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0; | ||
throw new Error("Symbol \"" + sym.name + "\" has no valueDeclaration and " + declarationCount + " declarations."); | ||
} | ||
@@ -361,3 +363,5 @@ function getSourceFile(sym) { | ||
var _a, _b; | ||
var _c = [doc.name, doc.text], name = _c[0], text = _c[1]; | ||
var name = doc.name; | ||
var originalText = doc.text ? doc.text.map(function (t) { return t.text; }).join("") : ""; | ||
var text = originalText; | ||
if (name.startsWith("TJS-")) { | ||
@@ -370,3 +374,3 @@ name = name.slice(4); | ||
else if (name === "TJS" && text.startsWith("-")) { | ||
var match = new RegExp(REGEX_TJS_JSDOC).exec(doc.text); | ||
var match = new RegExp(REGEX_TJS_JSDOC).exec(originalText); | ||
if (match) { | ||
@@ -761,6 +765,7 @@ name = match[1]; | ||
var decls = prop.declarations; | ||
return !((decls === null || decls === void 0 ? void 0 : decls.filter(function (decl) { | ||
var mods = decl.modifiers; | ||
return mods && mods.filter(function (mod) { return mod.kind === ts.SyntaxKind.PrivateKeyword; }).length > 0; | ||
}).length) > 0); | ||
return !(decls && | ||
decls.filter(function (decl) { | ||
var mods = decl.modifiers; | ||
return mods && mods.filter(function (mod) { return mod.kind === ts.SyntaxKind.PrivateKeyword; }).length > 0; | ||
}).length > 0); | ||
}); | ||
@@ -1143,3 +1148,3 @@ var fullName = this.tc.typeToString(clazzType, undefined, ts.TypeFormatFlags.UseFullyQualifiedType); | ||
function generateHashOfNode(node, relativePath) { | ||
return crypto_1.createHash("md5").update(relativePath).update(node.pos.toString()).digest("hex").substring(0, 8); | ||
return (0, crypto_1.createHash)("md5").update(relativePath).update(node.pos.toString()).digest("hex").substring(0, 8); | ||
} | ||
@@ -1300,3 +1305,3 @@ function buildGenerator(program, args, onlyIncludeFiles) { | ||
} | ||
json = stringify(definition, { space: 4 }) + "\n\n"; | ||
json = (0, safe_stable_stringify_1.stringify)(definition, null, 4) + "\n\n"; | ||
if (args.out) { | ||
@@ -1303,0 +1308,0 @@ return [2, new Promise(function (resolve, reject) { |
{ | ||
"name": "typescript-json-schema", | ||
"version": "0.51.0", | ||
"version": "0.52.0", | ||
"description": "typescript-json-schema generates JSON Schema files from your Typescript sources", | ||
@@ -51,5 +51,5 @@ "main": "dist/typescript-json-schema.js", | ||
"glob": "^7.1.7", | ||
"json-stable-stringify": "^1.0.1", | ||
"safe-stable-stringify": "^2.2.0", | ||
"ts-node": "^10.2.1", | ||
"typescript": "~4.2.3", | ||
"typescript": "~4.4.4", | ||
"yargs": "^17.1.1" | ||
@@ -60,3 +60,2 @@ }, | ||
"@types/glob": "^7.1.4", | ||
"@types/json-stable-stringify": "^1.0.33", | ||
"@types/mocha": "^9.0.0", | ||
@@ -74,3 +73,3 @@ "ajv": "^8.6.3", | ||
"test": "yarn build && mocha -t 5000 --require source-map-support/register dist/test", | ||
"debug": "ts-node --inspect=19248 --debug-brk typescript-json-schema-cli.ts", | ||
"debug": "node --inspect=19248 --inspect-brk -r ts-node/register typescript-json-schema-cli.ts", | ||
"docs": "./update-docs.js", | ||
@@ -77,0 +76,0 @@ "run": "ts-node typescript-json-schema-cli.ts", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
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
227939
10
3280
+ Addedsafe-stable-stringify@^2.2.0
+ Addedsafe-stable-stringify@2.5.0(transitive)
+ Addedtypescript@4.4.4(transitive)
- Removedjson-stable-stringify@^1.0.1
- Removedcall-bind@1.0.7(transitive)
- Removeddefine-data-property@1.1.4(transitive)
- Removedes-define-property@1.0.0(transitive)
- Removedes-errors@1.3.0(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-intrinsic@1.2.4(transitive)
- Removedgopd@1.0.1(transitive)
- Removedhas-property-descriptors@1.0.2(transitive)
- Removedhas-proto@1.0.3(transitive)
- Removedhas-symbols@1.0.3(transitive)
- Removedhasown@2.0.2(transitive)
- Removedisarray@2.0.5(transitive)
- Removedjson-stable-stringify@1.1.1(transitive)
- Removedjsonify@0.0.1(transitive)
- Removedobject-keys@1.1.1(transitive)
- Removedset-function-length@1.2.2(transitive)
- Removedtypescript@4.2.4(transitive)
Updatedtypescript@~4.4.4