@arrirpc/codegen-dart 0.77.1 → 0.79.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 CHANGED
@@ -11,7 +11,7 @@ const fs__default = /*#__PURE__*/_interopDefaultCompat(fs);
11
11
  const path__default = /*#__PURE__*/_interopDefaultCompat(path);
12
12
 
13
13
  function outputIsNullable(schema, context) {
14
- if (schema.nullable) {
14
+ if (schema.isNullable) {
15
15
  return true;
16
16
  }
17
17
  if (context.isOptional) {
@@ -241,7 +241,7 @@ function dartListFromSchema(schema, context) {
241
241
  if (context.isOptional) {
242
242
  return `${input}!.map((_el_) => ${innerType.toJson("_el_", "", "")}).toList()`;
243
243
  }
244
- if (schema.nullable) {
244
+ if (schema.isNullable) {
245
245
  return `${input}?.map((_el_) => ${innerType.toJson("_el_", "", "")}).toList()`;
246
246
  }
247
247
  return `${input}.map((_el_) => ${innerType.toJson("_el_", "", "")}).toList()`;
@@ -278,7 +278,7 @@ function dartClassFromSchema(schema, context) {
278
278
  if (context.isOptional) {
279
279
  return `${input}!.toJson()`;
280
280
  }
281
- if (schema.nullable) {
281
+ if (schema.isNullable) {
282
282
  return `${input}?.toJson()`;
283
283
  }
284
284
  return `${input}.toJson()`;
@@ -532,7 +532,7 @@ function dartSealedClassFromSchema(schema, context) {
532
532
  if (context.isOptional) {
533
533
  return `${input}!.toJson()`;
534
534
  }
535
- if (schema.nullable) {
535
+ if (schema.isNullable) {
536
536
  return `${input}?.toJson()`;
537
537
  }
538
538
  return `${input}.toJson()`;
@@ -605,7 +605,7 @@ function dartEnumFromSchema(schema, context) {
605
605
  if (context.isOptional) {
606
606
  return `${input}!.serialValue`;
607
607
  }
608
- if (schema.nullable) {
608
+ if (schema.isNullable) {
609
609
  return `${input}?.serialValue`;
610
610
  }
611
611
  return `${input}.serialValue`;
@@ -614,7 +614,7 @@ function dartEnumFromSchema(schema, context) {
614
614
  if (context.isOptional) {
615
615
  return `if (${input} != null) ${target}.add("${key}=\${${input}!.serialValue}")`;
616
616
  }
617
- if (schema.nullable) {
617
+ if (schema.isNullable) {
618
618
  return `${target}.add("${key}=\${${input}?.serialValue}")`;
619
619
  }
620
620
  return `${target}.add("${key}=\${${input}.serialValue}")`;
@@ -716,7 +716,7 @@ function dartDateTimeFromSchema(schema, context) {
716
716
  if (context.isOptional) {
717
717
  return `${input}!.toUtc().toIso8601String()`;
718
718
  }
719
- if (schema.nullable) {
719
+ if (schema.isNullable) {
720
720
  return `${input}?.toUtc().toIso8601String()`;
721
721
  }
722
722
  return `${input}.toUtc().toIso8601String()`;
@@ -725,7 +725,7 @@ function dartDateTimeFromSchema(schema, context) {
725
725
  if (context.isOptional) {
726
726
  return `if (${input} != null) ${target}.add("${key}=\${${input}!.toUtc().toIso8601String()}")`;
727
727
  }
728
- if (schema.nullable) {
728
+ if (schema.isNullable) {
729
729
  return `${target}.add("${key}=\${${input}?.toUtc().toIso8601String()}")`;
730
730
  }
731
731
  return `${target}.add("${key}=\${${input}.toUtc().toIso8601String()}")`;
@@ -803,7 +803,7 @@ function dartBigIntFromSchema(schema, context) {
803
803
  if (context.isOptional) {
804
804
  return `${input}!.toString()`;
805
805
  }
806
- if (schema.nullable) {
806
+ if (schema.isNullable) {
807
807
  return `${input}?.toString()`;
808
808
  }
809
809
  return `${input}.toString()`;
@@ -1028,7 +1028,7 @@ function dartMapFromSchema(schema, context) {
1028
1028
  if (context.isOptional) {
1029
1029
  return `${input}!.map((_key_, _val_) => MapEntry(_key_, ${innerType.toJson("_val_", "", "")},),)`;
1030
1030
  }
1031
- if (schema.nullable) {
1031
+ if (schema.isNullable) {
1032
1032
  return `${input}?.map((_key_, _val_) => MapEntry(_key_, ${innerType.toJson("_val_", "", "")},),)`;
1033
1033
  }
1034
1034
  return `${input}.map((_key_, _val_) => MapEntry(_key_, ${innerType.toJson("_val_", "", "")},),)`;
@@ -1067,7 +1067,7 @@ function dartRefFromSchema(schema, context) {
1067
1067
  if (context.isOptional) {
1068
1068
  return `${input}!.toJson()`;
1069
1069
  }
1070
- if (schema.nullable) {
1070
+ if (schema.isNullable) {
1071
1071
  return `${input}?.toJson()`;
1072
1072
  }
1073
1073
  return `${input}.toJson()`;
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { camelCase, pascalCase, removeDisallowedChars, isServiceDefinition, isRp
4
4
  import path from 'pathe';
5
5
 
6
6
  function outputIsNullable(schema, context) {
7
- if (schema.nullable) {
7
+ if (schema.isNullable) {
8
8
  return true;
9
9
  }
10
10
  if (context.isOptional) {
@@ -234,7 +234,7 @@ function dartListFromSchema(schema, context) {
234
234
  if (context.isOptional) {
235
235
  return `${input}!.map((_el_) => ${innerType.toJson("_el_", "", "")}).toList()`;
236
236
  }
237
- if (schema.nullable) {
237
+ if (schema.isNullable) {
238
238
  return `${input}?.map((_el_) => ${innerType.toJson("_el_", "", "")}).toList()`;
239
239
  }
240
240
  return `${input}.map((_el_) => ${innerType.toJson("_el_", "", "")}).toList()`;
@@ -271,7 +271,7 @@ function dartClassFromSchema(schema, context) {
271
271
  if (context.isOptional) {
272
272
  return `${input}!.toJson()`;
273
273
  }
274
- if (schema.nullable) {
274
+ if (schema.isNullable) {
275
275
  return `${input}?.toJson()`;
276
276
  }
277
277
  return `${input}.toJson()`;
@@ -525,7 +525,7 @@ function dartSealedClassFromSchema(schema, context) {
525
525
  if (context.isOptional) {
526
526
  return `${input}!.toJson()`;
527
527
  }
528
- if (schema.nullable) {
528
+ if (schema.isNullable) {
529
529
  return `${input}?.toJson()`;
530
530
  }
531
531
  return `${input}.toJson()`;
@@ -598,7 +598,7 @@ function dartEnumFromSchema(schema, context) {
598
598
  if (context.isOptional) {
599
599
  return `${input}!.serialValue`;
600
600
  }
601
- if (schema.nullable) {
601
+ if (schema.isNullable) {
602
602
  return `${input}?.serialValue`;
603
603
  }
604
604
  return `${input}.serialValue`;
@@ -607,7 +607,7 @@ function dartEnumFromSchema(schema, context) {
607
607
  if (context.isOptional) {
608
608
  return `if (${input} != null) ${target}.add("${key}=\${${input}!.serialValue}")`;
609
609
  }
610
- if (schema.nullable) {
610
+ if (schema.isNullable) {
611
611
  return `${target}.add("${key}=\${${input}?.serialValue}")`;
612
612
  }
613
613
  return `${target}.add("${key}=\${${input}.serialValue}")`;
@@ -709,7 +709,7 @@ function dartDateTimeFromSchema(schema, context) {
709
709
  if (context.isOptional) {
710
710
  return `${input}!.toUtc().toIso8601String()`;
711
711
  }
712
- if (schema.nullable) {
712
+ if (schema.isNullable) {
713
713
  return `${input}?.toUtc().toIso8601String()`;
714
714
  }
715
715
  return `${input}.toUtc().toIso8601String()`;
@@ -718,7 +718,7 @@ function dartDateTimeFromSchema(schema, context) {
718
718
  if (context.isOptional) {
719
719
  return `if (${input} != null) ${target}.add("${key}=\${${input}!.toUtc().toIso8601String()}")`;
720
720
  }
721
- if (schema.nullable) {
721
+ if (schema.isNullable) {
722
722
  return `${target}.add("${key}=\${${input}?.toUtc().toIso8601String()}")`;
723
723
  }
724
724
  return `${target}.add("${key}=\${${input}.toUtc().toIso8601String()}")`;
@@ -796,7 +796,7 @@ function dartBigIntFromSchema(schema, context) {
796
796
  if (context.isOptional) {
797
797
  return `${input}!.toString()`;
798
798
  }
799
- if (schema.nullable) {
799
+ if (schema.isNullable) {
800
800
  return `${input}?.toString()`;
801
801
  }
802
802
  return `${input}.toString()`;
@@ -1021,7 +1021,7 @@ function dartMapFromSchema(schema, context) {
1021
1021
  if (context.isOptional) {
1022
1022
  return `${input}!.map((_key_, _val_) => MapEntry(_key_, ${innerType.toJson("_val_", "", "")},),)`;
1023
1023
  }
1024
- if (schema.nullable) {
1024
+ if (schema.isNullable) {
1025
1025
  return `${input}?.map((_key_, _val_) => MapEntry(_key_, ${innerType.toJson("_val_", "", "")},),)`;
1026
1026
  }
1027
1027
  return `${input}.map((_key_, _val_) => MapEntry(_key_, ${innerType.toJson("_val_", "", "")},),)`;
@@ -1060,7 +1060,7 @@ function dartRefFromSchema(schema, context) {
1060
1060
  if (context.isOptional) {
1061
1061
  return `${input}!.toJson()`;
1062
1062
  }
1063
- if (schema.nullable) {
1063
+ if (schema.isNullable) {
1064
1064
  return `${input}?.toJson()`;
1065
1065
  }
1066
1066
  return `${input}.toJson()`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrirpc/codegen-dart",
3
- "version": "0.77.1",
3
+ "version": "0.79.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -23,6 +23,6 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "pathe": "^2.0.3",
26
- "@arrirpc/codegen-utils": "0.77.1"
26
+ "@arrirpc/codegen-utils": "0.79.0"
27
27
  }
28
28
  }