quicktype-core 23.0.40 → 23.0.41

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.
@@ -668,6 +668,9 @@ class SwiftRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
668
668
  if (!this._options.justTypes && this._options.alamofire) {
669
669
  this.emitLineOnce("import Alamofire");
670
670
  }
671
+ if (this._options.optionalEnums) {
672
+ this.emitLineOnce("import OptionallyDecodable // https://github.com/idrougge/OptionallyDecodable");
673
+ }
671
674
  this.ensureBlankLine();
672
675
  }
673
676
  renderTopLevelAlias(t, name) {
@@ -785,7 +788,7 @@ class SwiftRenderer extends ConvenienceRenderer_1.ConvenienceRenderer {
785
788
  let sources = [
786
789
  [
787
790
  this._options.optionalEnums && lastProperty.type.kind === "enum"
788
- ? `@NilOnFail${this._options.namedTypePrefix} `
791
+ ? `@OptionallyDecodable `
789
792
  : "",
790
793
  this.accessLevel,
791
794
  useMutableProperties || (this._options.optionalEnums && lastProperty.type.kind === "enum")
@@ -1155,18 +1158,6 @@ encoder.dateEncodingStrategy = .formatted(formatter)`);
1155
1158
  if (!this._options.justTypes) {
1156
1159
  this.emitSupportFunctions4();
1157
1160
  }
1158
- if (this._options.optionalEnums) {
1159
- this.emitBlockWithAccess(`@propertyWrapper public struct NilOnFail${this._options.namedTypePrefix}<T: Codable>: Codable`, () => {
1160
- this.emitMultiline(`
1161
- public let wrappedValue: T?
1162
- public init(from decoder: Decoder) throws {
1163
- wrappedValue = try? T(from: decoder)
1164
- }
1165
- public init(_ wrappedValue: T?) {
1166
- self.wrappedValue = wrappedValue
1167
- }`);
1168
- });
1169
- }
1170
1161
  }
1171
1162
  emitAlamofireExtension() {
1172
1163
  this.ensureBlankLine();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quicktype-core",
3
- "version": "23.0.40",
3
+ "version": "23.0.41",
4
4
  "description": "The quicktype engine as a library",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",