@krlwlfrt/tsg
Advanced tools
Comparing version 0.5.1 to 0.6.0
@@ -0,1 +1,10 @@ | ||
# [0.6.0](https://gitlab.com/krlwlfrt/tsg/compare/v0.5.1...v0.6.0) (2020-11-12) | ||
### Features | ||
* add possibility to have array types ([b4e0c13](https://gitlab.com/krlwlfrt/tsg/commit/b4e0c13e4528276d16dec447c53290db1d4dea1d)) | ||
## [0.5.1](https://gitlab.com/krlwlfrt/tsg/compare/v0.5.0...v0.5.1) (2020-05-11) | ||
@@ -2,0 +11,0 @@ |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generatePropertyType = exports.generateName = void 0; | ||
/* | ||
@@ -53,2 +54,2 @@ * Copyright (C) 2019, 2020 Karl-Philipp Wulfert | ||
exports.generatePropertyType = generatePropertyType; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXhhbXBsZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvZXhhbXBsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQTs7Ozs7Ozs7Ozs7OztHQWFHO0FBQ0gsbUNBQXlFO0FBRXpFOzs7O0dBSUc7QUFDSCxTQUFnQixZQUFZLENBQUMsS0FBZ0M7SUFDM0QsSUFBSSxtQkFBVyxDQUFDLEtBQUssQ0FBQyxFQUFFO1FBQ3RCLE9BQU8sS0FBSyxDQUFDLElBQUksQ0FBQztLQUNuQjtJQUVELElBQUksT0FBTyxLQUFLLENBQUMsU0FBUyxLQUFLLFFBQVEsSUFBSSxLQUFLLENBQUMsU0FBUyxDQUFDLE1BQU0sS0FBSyxDQUFDLEVBQUU7UUFDdkUsT0FBTyxLQUFLLENBQUMsSUFBSSxDQUFDO0tBQ25CO0lBRUQsT0FBTyxHQUFHLEtBQUssQ0FBQyxTQUFTLElBQUksS0FBSyxDQUFDLElBQUksRUFBRSxDQUFDO0FBQzVDLENBQUM7QUFW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LE9BQU8sS0FBSyxDQUFDLFNBQVMsS0FBSyxRQUFRLElBQUksS0FBSyxDQUFDLFNBQVMsQ0FBQyxNQUFNLEtBQUssQ0FBQyxFQUFFO1FBQ3ZFLE9BQU8sS0FBSyxDQUFDLElBQUksQ0FBQztLQUNuQjtJQUVELE9BQU8sR0FBRyxLQUFLLENBQUMsU0FBUyxJQUFJLEtBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQztBQUM1QyxDQUFDO0FBVkQsb0NBVUM7QUFFRDs7OztHQUlHO0FBQ0gsU0FBZ0Isb0JBQW9CLENBQUMsUUFBa0I7SUFDckQsSUFBSSxJQUFJLEdBQUcsWUFBWSxDQUFDLFFBQVEsQ0FBQyxJQUFJLENBQUMsQ0FBQztJQUV2QyxJQUFJLFFBQVEsQ0FBQyxJQUFJLENBQUMsU0FBUyxLQUFLLEtBQUssRUFBRTtRQUNyQyxJQUFJLEdBQUcsUUFBUSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsV0FBVyxFQUFFLENBQUM7S0FDekM7SUFFRCxJQUFJLEtBQUssQ0FBQyxPQUFPLENBQUMsUUFBUSxDQUFDLFVBQVUsQ0FBQyxFQUFFO1FBQ3RDLEtBQUssTUFBTSxTQUFTLElBQUksUUFBUSxDQUFDLFVBQVUsRUFBRTtZQUMzQyxJQUFJLFNBQVMsQ0FBQyxJQUFJLEtBQUssVUFBVSxJQUFJLE9BQU8sU0FBUyxDQUFDLEtBQUssS0FBSyxTQUFTLElBQUksU0FBUyxDQUFDLEtBQUssRUFBRTtnQkFDNUYsSUFBSSxJQUFJLFNBQVMsQ0FBQzthQUNuQjtTQUNGO0tBQ0Y7SUFFRCxPQUFPLElBQUksQ0FBQztBQUNkLENBQUM7QUFoQkQsb0RBZ0JDIn0= |
@@ -17,2 +17,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.generateTypeScript = exports.checkDuplicateNames = exports.isAttribute = exports.isEnum = exports.isUnion = exports.isEntity = void 0; | ||
/** | ||
@@ -192,4 +193,16 @@ * Check if a Type is an Entity | ||
else { | ||
output += `export type ${nameGenerator(type)} = ${propertyTypeGenerator(type)}; | ||
`; | ||
const propertyType = propertyTypeGenerator(type); | ||
output += `export type ${nameGenerator(type)} = `; | ||
if (type.multiple === true) { | ||
if (propertyType.indexOf('|') >= 0) { | ||
output += `Array<${propertyType}>`; | ||
} | ||
else { | ||
output += `${propertyType}[]`; | ||
} | ||
} | ||
else { | ||
output += `${propertyType}`; | ||
} | ||
output += `;\n`; | ||
} | ||
@@ -200,2 +213,2 @@ } | ||
exports.generateTypeScript = generateTypeScript; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOzs7Ozs7Ozs7Ozs7O0dBYUc7O0FBK0dIOzs7O0dBSUc7QUFDSCxTQUFnQixRQUFRLENBQUMsSUFBVTtJQUNqQyxJQUFJLENBQUMsQ0FBQyxZQUFZLElBQUksSUFBSSxDQUFDLEVBQUU7UUFDM0IsT0FBTyxLQUFLLENBQUM7S0FDZDtJQUVELE9BQU8sS0FBSyxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUM7QUFDeEMsQ0FBQztBQU5ELDRCQU1DO0FBRUQ7Ozs7R0FJRztBQUNILFNBQWdCLE9BQU8sQ0FBQyxJQUFVO0lBQ2hDLElBQUksQ0FBQyxDQUFDLGFBQWEsSUFBSSxJQUFJLENBQUMsRUFBRTtRQUM1QixPQUFPLEtBQUssQ0FBQztLQUNkO0lBRUQsT0FBTyxLQUFLLENBQUMsT0FBTyxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQztBQUN6QyxDQUFDO0FBTkQsMEJBTUM7QUFFRDs7OztHQUlHO0FBQ0gsU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BRUksS0FBSyxNQUFNLElBQUksSUFBSSxJQUFJLENBQUMsS0FBSyxFQUFFO2dCQUM3QixJQUFJLEtBQUssR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDO2dCQUV2QixJQUFJLE9BQU8sS0FBSyxLQUFLLFFBQVEsRUFBRTtvQkFDN0IsS0FBSyxHQUFHLElBQUksS0FBSyxHQUFHLENBQUM7aUJBQ3RCO2dCQUVELE1BQU0sSUFBSSxLQUFLLElBQUksQ0FBQyxHQUFHLE1BQU0sS0FBSztDQUN6QyxDQUFDO2FBQ0s7WUFFRCxNQUFNLElBQUk7Q0FDZixDQUFDO1NBQ0c7YUFBTTtZQUNMLE1BQU0sWUFBWSxHQUFHLHFCQUFxQixDQUFDLElBQUksQ0FBQyxDQUFDO1lBRWpELE1BQU0sSUFBSSxlQUFlLGFBQWEsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDO1lBRWxELElBQUksSUFBSSxDQUFDLFFBQVEsS0FBSyxJQUFJLEVBQUU7Z0JBQzFCLElBQUksWUFBWSxDQUFDLE9BQU8sQ0FBQyxHQUFHLENBQUMsSUFBSSxDQUFDLEVBQUU7b0JBQ2xDLE1BQU0sSUFBSSxTQUFTLFlBQVksR0FBRyxDQUFDO2lCQUNwQztxQkFBTTtvQkFDTCxNQUFNLElBQUksR0FBRyxZQUFZLElBQUksQ0FBQztpQkFDL0I7YUFDRjtpQkFBTTtnQkFDTCxNQUFNLElBQUksR0FBRyxZQUFZLEVBQUUsQ0FBQzthQUM3QjtZQUVELE1BQU0sSUFBSSxLQUFLLENBQUM7U0FDakI7S0FDRjtJQUVELE9BQU8sTUFBTSxDQUFDO0FBQ2hCLENBQUM7QUE1SEQsZ0RBNEhDIn0= |
{ | ||
"name": "@krlwlfrt/tsg", | ||
"version": "0.5.1", | ||
"version": "0.6.0", | ||
"description": "TypeScript generator", | ||
@@ -19,17 +19,17 @@ "repository": { | ||
"devDependencies": { | ||
"@openstapps/configuration": "0.24.0", | ||
"@types/chai": "4.2.11", | ||
"@types/mocha": "7.0.2", | ||
"@openstapps/configuration": "0.25.0", | ||
"@testdeck/mocha": "0.1.2", | ||
"@types/chai": "4.2.14", | ||
"@types/mocha": "8.0.4", | ||
"chai": "4.2.0", | ||
"conventional-changelog-cli": "2.0.34", | ||
"mocha": "7.1.2", | ||
"mocha-typescript": "1.1.17", | ||
"nyc": "15.0.1", | ||
"conventional-changelog-cli": "2.1.1", | ||
"mocha": "8.2.1", | ||
"nyc": "15.1.0", | ||
"prepend-file-cli": "1.0.6", | ||
"rimraf": "3.0.2", | ||
"ts-node": "8.10.1", | ||
"tslint": "6.1.2", | ||
"ts-node": "9.0.0", | ||
"tslint": "6.1.3", | ||
"tslint-eslint-rules": "5.4.0", | ||
"typedoc": "0.17.6", | ||
"typescript": "3.8.3" | ||
"typedoc": "0.19.2", | ||
"typescript": "4.0.5" | ||
}, | ||
@@ -46,3 +46,3 @@ "scripts": { | ||
"push": "git push && git push origin \"v$npm_package_version\"", | ||
"test": "nyc mocha --require ts-node/register --ui mocha-typescript 'test/**/*.spec.ts'", | ||
"test": "nyc mocha --require ts-node/register 'test/**/*.spec.ts'", | ||
"tslint": "tslint -p tsconfig.json -c tslint.json 'src/**/*.ts'", | ||
@@ -49,0 +49,0 @@ "typedoc": "typedoc --includeDeclarations --mode modules --out docs --readme README.md --listInvalidSymbolLinks src" |
@@ -330,4 +330,17 @@ /* | ||
} else { | ||
output += `export type ${nameGenerator(type)} = ${propertyTypeGenerator(type)}; | ||
`; | ||
const propertyType = propertyTypeGenerator(type); | ||
output += `export type ${nameGenerator(type)} = `; | ||
if (type.multiple === true) { | ||
if (propertyType.indexOf('|') >= 0) { | ||
output += `Array<${propertyType}>`; | ||
} else { | ||
output += `${propertyType}[]`; | ||
} | ||
} else { | ||
output += `${propertyType}`; | ||
} | ||
output += `;\n`; | ||
} | ||
@@ -334,0 +347,0 @@ } |
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
189882
4702