Skip to content

Commit 5514ffc

Browse files
committed
No need for replacements here.
1 parent b106cb0 commit 5514ffc

File tree

1 file changed

+1
-27
lines changed

1 file changed

+1
-27
lines changed

scripts/replacements.js

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -94,32 +94,6 @@ var string = '';
9494
\t\t);
9595
\t}
9696
\treturn _Utils_Tuple2(offset, string.join(''));
97-
});`)
98-
99-
/* Add Bytes encoder/decoder for ports support.
100-
Allows Bytes.Bytes to be sent through ports, mapping to Uint8Array on the JS side.
101-
*/
102-
.replace(
103-
`var _Json_encodeNull = _Json_wrap(null);`,
104-
`var _Json_encodeNull = _Json_wrap(null);
105-
106-
// BYTES FOR PORTS
107-
var _Json_decodeBytes = _Json_decodePrim(function(value) {
108-
\tif (value instanceof Uint8Array) {
109-
\t\treturn $elm$core$Result$Ok(new DataView(value.buffer, value.byteOffset, value.byteLength));
110-
\t}
111-
\tif (value instanceof ArrayBuffer) {
112-
\t\treturn $elm$core$Result$Ok(new DataView(value));
113-
\t}
114-
\tif (value instanceof DataView) {
115-
\t\treturn $elm$core$Result$Ok(value);
116-
\t}
117-
\treturn _Json_expecting('a BYTES value (Uint8Array, ArrayBuffer, or DataView)', value);
118-
});
119-
120-
var _Json_encodeBytes = function(bytes) {
121-
\treturn _Json_wrap(new Uint8Array(bytes.buffer, bytes.byteOffset, bytes.byteLength));
122-
};`
123-
);
97+
});`);
12498

12599
fs.writeFileSync(path, data, { encoding: 'utf8', flag: 'w' });

0 commit comments

Comments
 (0)