Skip to content

Commit 6fcb2cc

Browse files
Make Data typed-array constructor non-optional
1 parent 403ae95 commit 6fcb2cc

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Sources/JavaScriptFoundationCompat/Data+JSValue.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension Data: ConvertibleToJSValue, ConstructibleFromJSValue {
2222
public var jsValue: JSValue { jsTypedArray.jsValue }
2323

2424
/// Construct a Data from a JSTypedArray<UInt8>.
25-
public static func construct(from uint8Array: JSTypedArray<UInt8>) -> Data? {
25+
public static func construct(from uint8Array: JSTypedArray<UInt8>) -> Data {
2626
// First, allocate the data storage
2727
var data = Data(count: uint8Array.lengthInBytes)
2828
// Then, copy the byte contents into the Data buffer

0 commit comments

Comments
 (0)