@arrirpc/codegen-ts 0.69.2 → 0.70.1
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.
- package/dist/index.cjs +4 -8
- package/dist/index.mjs +4 -8
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -229,8 +229,7 @@ function tsObjectFromSchema(schema, context) {
|
|
|
229
229
|
usedFeatures: context.usedFeatures,
|
|
230
230
|
rpcGenerators: context.rpcGenerators
|
|
231
231
|
});
|
|
232
|
-
if (prop.content)
|
|
233
|
-
subContentParts.push(prop.content);
|
|
232
|
+
if (prop.content) subContentParts.push(prop.content);
|
|
234
233
|
const fieldName = validVarName(codegenUtils.camelCase(key, { normalize: true }));
|
|
235
234
|
fieldParts.push(
|
|
236
235
|
`${getJsDocComment(subSchema.metadata)}${fieldName}: ${prop.typeName},`
|
|
@@ -273,8 +272,7 @@ function tsObjectFromSchema(schema, context) {
|
|
|
273
272
|
usedFeatures: context.usedFeatures,
|
|
274
273
|
rpcGenerators: context.rpcGenerators
|
|
275
274
|
});
|
|
276
|
-
if (prop.content)
|
|
277
|
-
subContentParts.push(prop.content);
|
|
275
|
+
if (prop.content) subContentParts.push(prop.content);
|
|
278
276
|
const fieldName = validVarName(codegenUtils.camelCase(key, { normalize: true }));
|
|
279
277
|
fieldParts.push(
|
|
280
278
|
`${getJsDocComment(subSchema.metadata)}${fieldName}?: ${prop.typeName},`
|
|
@@ -383,8 +381,7 @@ function tsTaggedUnionFromSchema(schema, context) {
|
|
|
383
381
|
},
|
|
384
382
|
content: ""
|
|
385
383
|
};
|
|
386
|
-
if (context.generatedTypes.includes(typeName))
|
|
387
|
-
return result;
|
|
384
|
+
if (context.generatedTypes.includes(typeName)) return result;
|
|
388
385
|
const subTypes = [];
|
|
389
386
|
const discriminatorKey = schema.discriminator;
|
|
390
387
|
for (const key of Object.keys(schema.mapping)) {
|
|
@@ -903,8 +900,7 @@ function defineRpcGenerator(fn) {
|
|
|
903
900
|
}
|
|
904
901
|
function tsRpcFromDefinition(def, context) {
|
|
905
902
|
const customFn = context.rpcGenerators[def.transport];
|
|
906
|
-
if (customFn)
|
|
907
|
-
return customFn(def, context);
|
|
903
|
+
if (customFn) return customFn(def, context);
|
|
908
904
|
switch (def.transport) {
|
|
909
905
|
case "http":
|
|
910
906
|
return httpRpcFromDefinition(def, context);
|
package/dist/index.mjs
CHANGED
|
@@ -223,8 +223,7 @@ function tsObjectFromSchema(schema, context) {
|
|
|
223
223
|
usedFeatures: context.usedFeatures,
|
|
224
224
|
rpcGenerators: context.rpcGenerators
|
|
225
225
|
});
|
|
226
|
-
if (prop.content)
|
|
227
|
-
subContentParts.push(prop.content);
|
|
226
|
+
if (prop.content) subContentParts.push(prop.content);
|
|
228
227
|
const fieldName = validVarName(camelCase(key, { normalize: true }));
|
|
229
228
|
fieldParts.push(
|
|
230
229
|
`${getJsDocComment(subSchema.metadata)}${fieldName}: ${prop.typeName},`
|
|
@@ -267,8 +266,7 @@ function tsObjectFromSchema(schema, context) {
|
|
|
267
266
|
usedFeatures: context.usedFeatures,
|
|
268
267
|
rpcGenerators: context.rpcGenerators
|
|
269
268
|
});
|
|
270
|
-
if (prop.content)
|
|
271
|
-
subContentParts.push(prop.content);
|
|
269
|
+
if (prop.content) subContentParts.push(prop.content);
|
|
272
270
|
const fieldName = validVarName(camelCase(key, { normalize: true }));
|
|
273
271
|
fieldParts.push(
|
|
274
272
|
`${getJsDocComment(subSchema.metadata)}${fieldName}?: ${prop.typeName},`
|
|
@@ -377,8 +375,7 @@ function tsTaggedUnionFromSchema(schema, context) {
|
|
|
377
375
|
},
|
|
378
376
|
content: ""
|
|
379
377
|
};
|
|
380
|
-
if (context.generatedTypes.includes(typeName))
|
|
381
|
-
return result;
|
|
378
|
+
if (context.generatedTypes.includes(typeName)) return result;
|
|
382
379
|
const subTypes = [];
|
|
383
380
|
const discriminatorKey = schema.discriminator;
|
|
384
381
|
for (const key of Object.keys(schema.mapping)) {
|
|
@@ -897,8 +894,7 @@ function defineRpcGenerator(fn) {
|
|
|
897
894
|
}
|
|
898
895
|
function tsRpcFromDefinition(def, context) {
|
|
899
896
|
const customFn = context.rpcGenerators[def.transport];
|
|
900
|
-
if (customFn)
|
|
901
|
-
return customFn(def, context);
|
|
897
|
+
if (customFn) return customFn(def, context);
|
|
902
898
|
switch (def.transport) {
|
|
903
899
|
case "http":
|
|
904
900
|
return httpRpcFromDefinition(def, context);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arrirpc/codegen-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.70.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"prettier": "^3.4.
|
|
26
|
-
"@arrirpc/codegen-utils": "0.
|
|
25
|
+
"prettier": "^3.4.2",
|
|
26
|
+
"@arrirpc/codegen-utils": "0.70.1"
|
|
27
27
|
}
|
|
28
28
|
}
|