Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
virkt25 committed Jul 10, 2018
1 parent 8d8dd69 commit 6739e23
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cli/generators/model/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,10 @@ module.exports = class ModelGenerator extends ArtifactGenerator {
const TS_TYPES = ['string', 'number', 'object', 'boolean', 'any'];
const NON_TS_TYPES = ['geopoint', 'date'];
Object.entries(this.artifactInfo.properties).forEach(([key, val]) => {
// Default tsType is the type property
val.tsType = val.type;

// Override tsType based on certain type values
if (val.type === 'array') {
if (TS_TYPES.includes(val.arrayType)) {
val.tsType = `${val.arrayType}[]`;
Expand Down

0 comments on commit 6739e23

Please sign in to comment.