We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a4cb16 commit 32538ecCopy full SHA for 32538ec
Sources/JavaScriptKit/ConvertibleToJSValue.swift
@@ -131,9 +131,10 @@ extension Optional: ConstructibleFromJSValue where Wrapped: ConstructibleFromJSV
131
public static func construct(from value: JSValue) -> Self? {
132
switch value {
133
case .null, .undefined:
134
- return nil
+ return .some(nil)
135
default:
136
- return Wrapped.construct(from: value)
+ guard let wrapped = Wrapped.construct(from: value) else { return nil }
137
+ return .some(wrapped)
138
}
139
140
0 commit comments