@arrirpc/codegen-ts 0.66.0 → 0.67.0
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 +6 -6
- package/dist/index.mjs +6 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -231,7 +231,7 @@ function tsObjectFromSchema(schema, context) {
|
|
|
231
231
|
});
|
|
232
232
|
if (prop.content)
|
|
233
233
|
subContentParts.push(prop.content);
|
|
234
|
-
const fieldName = validVarName(codegenUtils.camelCase(key));
|
|
234
|
+
const fieldName = validVarName(codegenUtils.camelCase(key, { normalize: true }));
|
|
235
235
|
fieldParts.push(
|
|
236
236
|
`${getJsDocComment(subSchema.metadata)}${fieldName}: ${prop.typeName},`
|
|
237
237
|
);
|
|
@@ -275,7 +275,7 @@ function tsObjectFromSchema(schema, context) {
|
|
|
275
275
|
});
|
|
276
276
|
if (prop.content)
|
|
277
277
|
subContentParts.push(prop.content);
|
|
278
|
-
const fieldName = validVarName(codegenUtils.camelCase(key));
|
|
278
|
+
const fieldName = validVarName(codegenUtils.camelCase(key, { normalize: true }));
|
|
279
279
|
fieldParts.push(
|
|
280
280
|
`${getJsDocComment(subSchema.metadata)}${fieldName}?: ${prop.typeName},`
|
|
281
281
|
);
|
|
@@ -285,15 +285,15 @@ function tsObjectFromSchema(schema, context) {
|
|
|
285
285
|
${prop.fromJsonTemplate(`input.${key}`, tempKey)}
|
|
286
286
|
}`);
|
|
287
287
|
if (hasKey) {
|
|
288
|
-
toJsonParts.push(`if (typeof input.${
|
|
288
|
+
toJsonParts.push(`if (typeof input.${fieldName} !== 'undefined') {
|
|
289
289
|
json += \`,"${key}":\`;
|
|
290
|
-
${prop.toJsonTemplate(`input.${
|
|
290
|
+
${prop.toJsonTemplate(`input.${fieldName}`, "json", key)}
|
|
291
291
|
}`);
|
|
292
292
|
} else {
|
|
293
|
-
toJsonParts.push(`if (typeof input.${
|
|
293
|
+
toJsonParts.push(`if (typeof input.${fieldName} !== 'undefined') {
|
|
294
294
|
if (_hasKey) json += ',';
|
|
295
295
|
json += '"${key}":';
|
|
296
|
-
${prop.toJsonTemplate(`input.${
|
|
296
|
+
${prop.toJsonTemplate(`input.${fieldName}`, "json", key)}
|
|
297
297
|
_hasKey = true;
|
|
298
298
|
}`);
|
|
299
299
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -225,7 +225,7 @@ function tsObjectFromSchema(schema, context) {
|
|
|
225
225
|
});
|
|
226
226
|
if (prop.content)
|
|
227
227
|
subContentParts.push(prop.content);
|
|
228
|
-
const fieldName = validVarName(camelCase(key));
|
|
228
|
+
const fieldName = validVarName(camelCase(key, { normalize: true }));
|
|
229
229
|
fieldParts.push(
|
|
230
230
|
`${getJsDocComment(subSchema.metadata)}${fieldName}: ${prop.typeName},`
|
|
231
231
|
);
|
|
@@ -269,7 +269,7 @@ function tsObjectFromSchema(schema, context) {
|
|
|
269
269
|
});
|
|
270
270
|
if (prop.content)
|
|
271
271
|
subContentParts.push(prop.content);
|
|
272
|
-
const fieldName = validVarName(camelCase(key));
|
|
272
|
+
const fieldName = validVarName(camelCase(key, { normalize: true }));
|
|
273
273
|
fieldParts.push(
|
|
274
274
|
`${getJsDocComment(subSchema.metadata)}${fieldName}?: ${prop.typeName},`
|
|
275
275
|
);
|
|
@@ -279,15 +279,15 @@ function tsObjectFromSchema(schema, context) {
|
|
|
279
279
|
${prop.fromJsonTemplate(`input.${key}`, tempKey)}
|
|
280
280
|
}`);
|
|
281
281
|
if (hasKey) {
|
|
282
|
-
toJsonParts.push(`if (typeof input.${
|
|
282
|
+
toJsonParts.push(`if (typeof input.${fieldName} !== 'undefined') {
|
|
283
283
|
json += \`,"${key}":\`;
|
|
284
|
-
${prop.toJsonTemplate(`input.${
|
|
284
|
+
${prop.toJsonTemplate(`input.${fieldName}`, "json", key)}
|
|
285
285
|
}`);
|
|
286
286
|
} else {
|
|
287
|
-
toJsonParts.push(`if (typeof input.${
|
|
287
|
+
toJsonParts.push(`if (typeof input.${fieldName} !== 'undefined') {
|
|
288
288
|
if (_hasKey) json += ',';
|
|
289
289
|
json += '"${key}":';
|
|
290
|
-
${prop.toJsonTemplate(`input.${
|
|
290
|
+
${prop.toJsonTemplate(`input.${fieldName}`, "json", key)}
|
|
291
291
|
_hasKey = true;
|
|
292
292
|
}`);
|
|
293
293
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arrirpc/codegen-ts",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"prettier": "^3.3.3",
|
|
26
|
-
"@arrirpc/codegen-utils": "0.
|
|
26
|
+
"@arrirpc/codegen-utils": "0.67.0"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {}
|
|
29
29
|
}
|