@arrirpc/codegen-dart 0.74.1 → 0.75.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 CHANGED
@@ -404,11 +404,12 @@ function dartClassFromSchema(schema, context) {
404
404
  String get ${validDartIdentifier(context.discriminatorKey)} => "${context.discriminatorValue}";
405
405
  `;
406
406
  }
407
+ const hasProperties = propNames.length > 0;
407
408
  result.content = `${getCodeComments(schema.metadata)}class ${finalClassName} implements ${context.discriminatorParentId ? `${context.modelPrefix}${context.discriminatorParentId}` : "ArriModel"} {
408
409
  ${fieldParts.join("\n")}
409
- const ${finalClassName}({
410
+ const ${finalClassName}(${hasProperties ? "{" : ""}
410
411
  ${constructorParts.join("\n")}
411
- });
412
+ ${hasProperties ? "}" : ""});
412
413
  ${discriminatorPart}
413
414
  factory ${finalClassName}.empty() {
414
415
  return ${finalClassName}(
@@ -449,9 +450,9 @@ ${toUrlQueryParts.join("\n")}
449
450
  }
450
451
 
451
452
  @override
452
- ${finalClassName} copyWith({
453
+ ${finalClassName} copyWith(${hasProperties ? "{" : ""}
453
454
  ${copyWithParamParts.join("\n")}
454
- }) {
455
+ ${hasProperties ? "}" : ""}) {
455
456
  return ${finalClassName}(
456
457
  ${copyWithReturnParts.join("\n")}
457
458
  );
package/dist/index.mjs CHANGED
@@ -397,11 +397,12 @@ function dartClassFromSchema(schema, context) {
397
397
  String get ${validDartIdentifier(context.discriminatorKey)} => "${context.discriminatorValue}";
398
398
  `;
399
399
  }
400
+ const hasProperties = propNames.length > 0;
400
401
  result.content = `${getCodeComments(schema.metadata)}class ${finalClassName} implements ${context.discriminatorParentId ? `${context.modelPrefix}${context.discriminatorParentId}` : "ArriModel"} {
401
402
  ${fieldParts.join("\n")}
402
- const ${finalClassName}({
403
+ const ${finalClassName}(${hasProperties ? "{" : ""}
403
404
  ${constructorParts.join("\n")}
404
- });
405
+ ${hasProperties ? "}" : ""});
405
406
  ${discriminatorPart}
406
407
  factory ${finalClassName}.empty() {
407
408
  return ${finalClassName}(
@@ -442,9 +443,9 @@ ${toUrlQueryParts.join("\n")}
442
443
  }
443
444
 
444
445
  @override
445
- ${finalClassName} copyWith({
446
+ ${finalClassName} copyWith(${hasProperties ? "{" : ""}
446
447
  ${copyWithParamParts.join("\n")}
447
- }) {
448
+ ${hasProperties ? "}" : ""}) {
448
449
  return ${finalClassName}(
449
450
  ${copyWithReturnParts.join("\n")}
450
451
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrirpc/codegen-dart",
3
- "version": "0.74.1",
3
+ "version": "0.75.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
- "pathe": "^2.0.2",
26
- "@arrirpc/codegen-utils": "0.74.1"
25
+ "pathe": "^2.0.3",
26
+ "@arrirpc/codegen-utils": "0.75.1"
27
27
  }
28
28
  }