@goast/typescript 0.2.11 → 0.2.13

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.
@@ -199,7 +199,7 @@ class DefaultTypeScriptAngularServiceGenerator extends file_generator_1.TypeScri
199
199
  const options = ast_1.ts.object({
200
200
  members: [
201
201
  p.style !== undefined ? ast_1.ts.property('style', { value: ast_1.ts.string(p.style) }) : null,
202
- p.explode !== undefined ? ast_1.ts.property('explode', { value: p.explode }) : null,
202
+ p.explode !== undefined ? ast_1.ts.property('explode', { value: ast_1.ts.toNode(p.explode) }) : null,
203
203
  ],
204
204
  });
205
205
  return (0, core_1.builderTemplate) `rb.${p.target}(${ast_1.ts.string(p.name)}, params.${(0, core_1.toCasing)(p.name, ctx.config.propertyNameCasing)}, ${options});`;
@@ -137,7 +137,11 @@ class DefaultTypeScriptEasyNetworkStubGenerator extends file_generator_1.TypeScr
137
137
  let path = endpoint.path;
138
138
  let isFirstQueryParam = true;
139
139
  for (const param of endpoint.parameters) {
140
- const type = ((_b = (param.schema && ((_a = ctx.input.models[param.schema.id]) === null || _a === void 0 ? void 0 : _a.component))) !== null && _b !== void 0 ? _b : ast_1.ts.refs.unknown.name).replace(/^readonly /, '');
140
+ let type = ((_b = (param.schema && ((_a = ctx.input.models[param.schema.id]) === null || _a === void 0 ? void 0 : _a.component))) !== null && _b !== void 0 ? _b : ast_1.ts.refs.unknown.name).replace(/^readonly /, '');
141
+ const arrayMatch = /^\((.*)\)\[\]$/.exec(type);
142
+ if (arrayMatch !== null) {
143
+ type = `${arrayMatch[1]}[]`;
144
+ }
141
145
  if (param.target === 'path') {
142
146
  path = path.replace(`{${param.name}}`, `{${param.name}${param.required ? '' : '?'}:${type}}`);
143
147
  }
@@ -196,7 +196,7 @@ export class DefaultTypeScriptAngularServiceGenerator extends TypeScriptFileGene
196
196
  const options = ts.object({
197
197
  members: [
198
198
  p.style !== undefined ? ts.property('style', { value: ts.string(p.style) }) : null,
199
- p.explode !== undefined ? ts.property('explode', { value: p.explode }) : null,
199
+ p.explode !== undefined ? ts.property('explode', { value: ts.toNode(p.explode) }) : null,
200
200
  ],
201
201
  });
202
202
  return s `rb.${p.target}(${ts.string(p.name)}, params.${toCasing(p.name, ctx.config.propertyNameCasing)}, ${options});`;
@@ -134,7 +134,11 @@ export class DefaultTypeScriptEasyNetworkStubGenerator extends TypeScriptFileGen
134
134
  let path = endpoint.path;
135
135
  let isFirstQueryParam = true;
136
136
  for (const param of endpoint.parameters) {
137
- const type = ((_b = (param.schema && ((_a = ctx.input.models[param.schema.id]) === null || _a === void 0 ? void 0 : _a.component))) !== null && _b !== void 0 ? _b : ts.refs.unknown.name).replace(/^readonly /, '');
137
+ let type = ((_b = (param.schema && ((_a = ctx.input.models[param.schema.id]) === null || _a === void 0 ? void 0 : _a.component))) !== null && _b !== void 0 ? _b : ts.refs.unknown.name).replace(/^readonly /, '');
138
+ const arrayMatch = /^\((.*)\)\[\]$/.exec(type);
139
+ if (arrayMatch !== null) {
140
+ type = `${arrayMatch[1]}[]`;
141
+ }
138
142
  if (param.target === 'path') {
139
143
  path = path.replace(`{${param.name}}`, `{${param.name}${param.required ? '' : '?'}:${type}}`);
140
144
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goast/typescript",
3
- "version": "0.2.11",
3
+ "version": "0.2.13",
4
4
  "repository": "https://github.com/MaSch0212/goast.git",
5
5
  "author": {
6
6
  "name": "Marc Schmidt (MaSch0212)",