@json-schema-tools/transpiler
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -101,3 +101,13 @@ "use strict"; | ||
}, []); | ||
if (s.additionalProperties === undefined) { | ||
if (s.patternProperties !== undefined) { | ||
var subTypes_1 = []; | ||
Object.values(s.patternProperties).forEach(function (prop) { | ||
var title = _this.getSafeTitle(_this.refToTitle(prop)); | ||
if (subTypes_1.includes(title) === false) { | ||
subTypes_1.push(title); | ||
} | ||
}); | ||
propertyTypings.push(" [regex: string]: " + subTypes_1.join(" | ") + " | any;"); | ||
} | ||
else if (s.additionalProperties !== false) { | ||
propertyTypings.push(" [k: string]: any;"); | ||
@@ -104,0 +114,0 @@ } |
@@ -0,1 +1,16 @@ | ||
# [1.4.0](https://github.com/json-schema-tools/transpiler/compare/1.3.0...1.4.0) (2020-07-28) | ||
### Bug Fixes | ||
* add to package json and remove hold ([385774e](https://github.com/json-schema-tools/transpiler/commit/385774e0f60983acfd66b64d9ae5c38df75f1245)) | ||
* adjust circle buld ([22d2105](https://github.com/json-schema-tools/transpiler/commit/22d2105c656ed4cd2aa11474bfe4186a8434a6c7)) | ||
* properly set repo ([6fab520](https://github.com/json-schema-tools/transpiler/commit/6fab520f7c8460ac4ead65d5741192fc2d68cd08)) | ||
* update package lock ([4059b56](https://github.com/json-schema-tools/transpiler/commit/4059b564dacfabe149caaee6e4e062dccc80b5ad)) | ||
### Features | ||
* generate code for patternProperties ([c5e38b9](https://github.com/json-schema-tools/transpiler/commit/c5e38b9e6feaaea34e334a314224f21ff5681685)) | ||
# [1.3.0](https://github.com/json-schema-tools/transpiler/compare/1.2.1...1.3.0) (2020-07-21) | ||
@@ -2,0 +17,0 @@ |
{ | ||
"name": "@json-schema-tools/transpiler", | ||
"version": "1.3.0", | ||
"description": "", | ||
"version": "1.4.0", | ||
"description": "Turn your json schema into typings for various languages. Achieve master class dev tooling.", | ||
"main": "build/index.js", | ||
@@ -12,10 +12,19 @@ "publishConfig": { | ||
"lint": "tslint --fix -p .", | ||
"test": "npm run lint && jest --coverage" | ||
"test": "npm run lint && jest --coverage", | ||
"generateTest": "tsc && node ./build/integration-tests/generator.js" | ||
}, | ||
"author": "", | ||
"homepage": "https://json-schema.tools", | ||
"bugs": { | ||
"url": "https://github.com/json-schema-tools/transpiler/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/json-schema-tools/transpiler.git" | ||
}, | ||
"author": "Zachary Belford<belfordz66@gmail.com>", | ||
"license": "Apache-2.0", | ||
"devDependencies": { | ||
"@json-schema-tools/dereferencer": "^1.1.0", | ||
"@json-schema-tools/meta-schema": "^1.3.0", | ||
"@types/inquirer": "^6.5.0", | ||
"@json-schema-tools/meta-schema": "^1.4.0", | ||
"@types/inquirer": "^7.3.0", | ||
"@types/jest": "^26.0.3", | ||
@@ -29,3 +38,3 @@ "@types/json-schema": "^7.0.5", | ||
"fetch": "^1.1.0", | ||
"inquirer": "^7.2.0", | ||
"inquirer": "^7.3.3", | ||
"jest": "^24.8.0", | ||
@@ -39,3 +48,3 @@ "node-fetch": "^2.6.0", | ||
"dependencies": { | ||
"@json-schema-tools/traverse": "^1.4.2", | ||
"@json-schema-tools/traverse": "^1.5.0", | ||
"lodash.deburr": "^4.1.0", | ||
@@ -42,0 +51,0 @@ "lodash.trim": "^4.5.1" |
@@ -89,3 +89,12 @@ import { JSONSchema, Enum, JSONSchemaObject } from "@json-schema-tools/meta-schema"; | ||
if (s.additionalProperties === undefined) { | ||
if (s.patternProperties !== undefined) { | ||
const subTypes: string[] = []; | ||
Object.values(s.patternProperties).forEach((prop: JSONSchema) => { | ||
const title = this.getSafeTitle(this.refToTitle(prop)); | ||
if (subTypes.includes(title) === false) { | ||
subTypes.push(title); | ||
} | ||
}); | ||
propertyTypings.push(` [regex: string]: ${subTypes.join(" | ")} | any;`); | ||
} else if (s.additionalProperties !== false) { | ||
propertyTypings.push(" [k: string]: any;"); | ||
@@ -92,0 +101,0 @@ } |
Sorry, the diff of this file is not supported yet
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
289715
128
6228
0
0
3