@goast/typescript 0.2.10 → 0.2.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -102,7 +102,7 @@ class DefaultTypeScriptModelGenerator extends file_generator_1.TypeScriptFileGen
102
102
  getIndexer(ctx, schema) {
103
103
  var _a;
104
104
  return schema.additionalProperties
105
- ? ast_1.ts.indexer('string', (_a = (schema.additionalProperties === true ? null : this.getType(ctx, schema.additionalProperties))) !== null && _a !== void 0 ? _a : this.getAnyType(ctx), { readonly: ctx.config.immutableTypes })
105
+ ? ast_1.ts.indexer(ast_1.ts.refs.string(), (_a = (schema.additionalProperties === true ? null : this.getType(ctx, schema.additionalProperties))) !== null && _a !== void 0 ? _a : this.getAnyType(ctx), { readonly: ctx.config.immutableTypes })
106
106
  : null;
107
107
  }
108
108
  getProperties(ctx, schema) {
@@ -170,7 +170,9 @@ class DefaultTypeScriptModelGenerator extends file_generator_1.TypeScriptFileGen
170
170
  schema.allOf.length > 0 || schema.anyOf.length > 0 ? this.getCombinedType(ctx, schema) : null,
171
171
  ].filter(core_1.notNullish);
172
172
  if (parts.length === 0) {
173
- parts.push(ast_1.ts.objectType());
173
+ parts.push(ast_1.ts.objectType({
174
+ members: [ast_1.ts.indexer(ast_1.ts.refs.string(), ast_1.ts.refs.never(), { readonly: ctx.config.immutableTypes })],
175
+ }));
174
176
  }
175
177
  return ast_1.ts.intersectionType(parts);
176
178
  }
@@ -99,7 +99,7 @@ export class DefaultTypeScriptModelGenerator extends TypeScriptFileGenerator {
99
99
  getIndexer(ctx, schema) {
100
100
  var _a;
101
101
  return schema.additionalProperties
102
- ? ts.indexer('string', (_a = (schema.additionalProperties === true ? null : this.getType(ctx, schema.additionalProperties))) !== null && _a !== void 0 ? _a : this.getAnyType(ctx), { readonly: ctx.config.immutableTypes })
102
+ ? ts.indexer(ts.refs.string(), (_a = (schema.additionalProperties === true ? null : this.getType(ctx, schema.additionalProperties))) !== null && _a !== void 0 ? _a : this.getAnyType(ctx), { readonly: ctx.config.immutableTypes })
103
103
  : null;
104
104
  }
105
105
  getProperties(ctx, schema) {
@@ -167,7 +167,9 @@ export class DefaultTypeScriptModelGenerator extends TypeScriptFileGenerator {
167
167
  schema.allOf.length > 0 || schema.anyOf.length > 0 ? this.getCombinedType(ctx, schema) : null,
168
168
  ].filter(notNullish);
169
169
  if (parts.length === 0) {
170
- parts.push(ts.objectType());
170
+ parts.push(ts.objectType({
171
+ members: [ts.indexer(ts.refs.string(), ts.refs.never(), { readonly: ctx.config.immutableTypes })],
172
+ }));
171
173
  }
172
174
  return ts.intersectionType(parts);
173
175
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goast/typescript",
3
- "version": "0.2.10",
3
+ "version": "0.2.11",
4
4
  "repository": "https://github.com/MaSch0212/goast.git",
5
5
  "author": {
6
6
  "name": "Marc Schmidt (MaSch0212)",