@arrirpc/codegen-swift 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 CHANGED
@@ -347,8 +347,7 @@ function swiftObjectFromSchema(schema, context) {
347
347
  generatedTypes: context.generatedTypes,
348
348
  containsRequiredRef: context.containsRequiredRef
349
349
  });
350
- if (subType.content)
351
- subContent.push(subType.content);
350
+ if (subType.content) subContent.push(subType.content);
352
351
  if (subType.hasRequiredRef && !subType.isNullable) {
353
352
  context.containsRequiredRef[typeName] = true;
354
353
  result.hasRequiredRef = true;
@@ -356,8 +355,7 @@ function swiftObjectFromSchema(schema, context) {
356
355
  if (codegenUtils.isSchemaFormRef(subSchema)) {
357
356
  hasRecursiveSubType = true;
358
357
  }
359
- if (subType.canBeQueryString)
360
- canBeQueryString = true;
358
+ if (subType.canBeQueryString) canBeQueryString = true;
361
359
  const fieldName = validSwiftKey(key);
362
360
  fieldNames.push(fieldName);
363
361
  if (subType.defaultValue) {
@@ -384,8 +382,7 @@ function swiftObjectFromSchema(schema, context) {
384
382
  toJsonParts.push(` __json += "\\"${key}\\":"`);
385
383
  }
386
384
  toJsonParts.push(subType.toJsonTemplate(`self.${fieldName}`, `__json`));
387
- if (subType.canBeQueryString)
388
- canBeQueryString = true;
385
+ if (subType.canBeQueryString) canBeQueryString = true;
389
386
  toQueryStringParts.push(
390
387
  subType.toQueryPartTemplate(
391
388
  `self.${fieldName}`,
@@ -422,13 +419,11 @@ function swiftObjectFromSchema(schema, context) {
422
419
  isOptional: true,
423
420
  containsRequiredRef: context.containsRequiredRef
424
421
  });
425
- if (subType.content)
426
- subContent.push(subType.content);
422
+ if (subType.content) subContent.push(subType.content);
427
423
  if (codegenUtils.isSchemaFormRef(subSchema)) {
428
424
  hasRecursiveSubType = true;
429
425
  }
430
- if (subType.canBeQueryString)
431
- canBeQueryString = true;
426
+ if (subType.canBeQueryString) canBeQueryString = true;
432
427
  const fieldName = validSwiftKey(key);
433
428
  fieldNames.push(fieldName);
434
429
  fieldNameParts.push(
@@ -465,8 +460,7 @@ __numKeys += 1`;
465
460
  toJsonParts.push(` if self.${fieldName} != nil {
466
461
  ${toJsonContent}
467
462
  }`);
468
- if (subType.canBeQueryString)
469
- canBeQueryString = true;
463
+ if (subType.canBeQueryString) canBeQueryString = true;
470
464
  toQueryStringParts.push(
471
465
  subType.toQueryPartTemplate(
472
466
  `self.${fieldName}`,
@@ -640,8 +634,7 @@ function swiftTaggedUnionFromSchema(schema, context) {
640
634
  }
641
635
  let defaultPart;
642
636
  for (const part of discriminatorParts) {
643
- if (part.hasRequiredRef)
644
- continue;
637
+ if (part.hasRequiredRef) continue;
645
638
  defaultPart = part;
646
639
  break;
647
640
  }
package/dist/index.mjs CHANGED
@@ -341,8 +341,7 @@ function swiftObjectFromSchema(schema, context) {
341
341
  generatedTypes: context.generatedTypes,
342
342
  containsRequiredRef: context.containsRequiredRef
343
343
  });
344
- if (subType.content)
345
- subContent.push(subType.content);
344
+ if (subType.content) subContent.push(subType.content);
346
345
  if (subType.hasRequiredRef && !subType.isNullable) {
347
346
  context.containsRequiredRef[typeName] = true;
348
347
  result.hasRequiredRef = true;
@@ -350,8 +349,7 @@ function swiftObjectFromSchema(schema, context) {
350
349
  if (isSchemaFormRef(subSchema)) {
351
350
  hasRecursiveSubType = true;
352
351
  }
353
- if (subType.canBeQueryString)
354
- canBeQueryString = true;
352
+ if (subType.canBeQueryString) canBeQueryString = true;
355
353
  const fieldName = validSwiftKey(key);
356
354
  fieldNames.push(fieldName);
357
355
  if (subType.defaultValue) {
@@ -378,8 +376,7 @@ function swiftObjectFromSchema(schema, context) {
378
376
  toJsonParts.push(` __json += "\\"${key}\\":"`);
379
377
  }
380
378
  toJsonParts.push(subType.toJsonTemplate(`self.${fieldName}`, `__json`));
381
- if (subType.canBeQueryString)
382
- canBeQueryString = true;
379
+ if (subType.canBeQueryString) canBeQueryString = true;
383
380
  toQueryStringParts.push(
384
381
  subType.toQueryPartTemplate(
385
382
  `self.${fieldName}`,
@@ -416,13 +413,11 @@ function swiftObjectFromSchema(schema, context) {
416
413
  isOptional: true,
417
414
  containsRequiredRef: context.containsRequiredRef
418
415
  });
419
- if (subType.content)
420
- subContent.push(subType.content);
416
+ if (subType.content) subContent.push(subType.content);
421
417
  if (isSchemaFormRef(subSchema)) {
422
418
  hasRecursiveSubType = true;
423
419
  }
424
- if (subType.canBeQueryString)
425
- canBeQueryString = true;
420
+ if (subType.canBeQueryString) canBeQueryString = true;
426
421
  const fieldName = validSwiftKey(key);
427
422
  fieldNames.push(fieldName);
428
423
  fieldNameParts.push(
@@ -459,8 +454,7 @@ __numKeys += 1`;
459
454
  toJsonParts.push(` if self.${fieldName} != nil {
460
455
  ${toJsonContent}
461
456
  }`);
462
- if (subType.canBeQueryString)
463
- canBeQueryString = true;
457
+ if (subType.canBeQueryString) canBeQueryString = true;
464
458
  toQueryStringParts.push(
465
459
  subType.toQueryPartTemplate(
466
460
  `self.${fieldName}`,
@@ -634,8 +628,7 @@ function swiftTaggedUnionFromSchema(schema, context) {
634
628
  }
635
629
  let defaultPart;
636
630
  for (const part of discriminatorParts) {
637
- if (part.hasRequiredRef)
638
- continue;
631
+ if (part.hasRequiredRef) continue;
639
632
  defaultPart = part;
640
633
  break;
641
634
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arrirpc/codegen-swift",
3
- "version": "0.69.2",
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
- "@arrirpc/codegen-utils": "0.69.2"
25
+ "@arrirpc/codegen-utils": "0.70.1"
26
26
  },
27
27
  "devDependencies": {}
28
28
  }