Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.

Commit 5ab0acd

Browse files
committed
no need to unwrap newtypes
1 parent a2182b1 commit 5ab0acd

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/DOM/File/Blob.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ exports.typeImpl = function (blob) { return blob.type; };
44

55
exports.size = function (blob) { return blob.size; };
66

7-
exports._slice = function (blob) {
7+
exports._slice = function (contentType) {
88
return function (start) {
99
return function (end) {
10-
return function (contentType) {
10+
return function (blob) {
1111
return blob.slice(start, end, contentType);
1212
}
1313
}

src/DOM/File/Blob.purs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,9 @@ idxFromNumber = round >>> unsafeCoerce
6161

6262
-- | Creates a new `Blob` object (with specified `MediaType`), containing the
6363
-- | data in the specified range of bytes of the source Blob, by setting .
64-
slice MediaType -> StartByte -> EndByte -> Blob -> Blob
65-
slice mediaType (StartByte start) (EndByte end) blob =
66-
_slice blob start end (unwrap mediaType)
64+
foreign import slice MediaType -> StartByte -> EndByte -> Blob -> Blob
6765

6866
-- | Creates a new `Blob` object containing the data in the specified range
6967
-- | of bytes of the source Blob.
7068
slice' StartByte -> EndByte -> Blob -> Blob
71-
slice' (StartByte start) (EndByte end) blob = _slice blob start end ""
72-
73-
foreign import _slice Blob -> ByteIdx -> ByteIdx -> String -> Blob
69+
slice' = slice (MediaType "")

0 commit comments

Comments
 (0)