Skip to content

Commit

Permalink
Fix for browserify-zlib
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwhitington committed Aug 12, 2022
1 parent 97c0f45 commit b8e63c0
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 10 deletions.
6 changes: 4 additions & 2 deletions cpdfzlib.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
function camlpdf_caml_zlib_decompress(s)
{
var s2 = caml_array_of_bytes(s);
var output = cpdf_zlib.inflateSync(s2);
var buf = Buffer.from(s2); // browserify-zlib can't cope with just uint8array
var output = cpdf_zlib.inflateSync(buf);
return caml_bytes_of_array(output);
}

Expand All @@ -14,7 +15,8 @@ function camlpdf_caml_zlib_decompress(s)
function camlpdf_caml_zlib_compress(s)
{
var s2 = caml_array_of_bytes(s);
var output = cpdf_zlib.deflateSync(s2);
var buf = Buffer.from(s2); // browserify-zlib can't cope with just uint8array
var output = cpdf_zlib.deflateSync(buf);
return caml_bytes_of_array(output);
}

Expand Down
10 changes: 7 additions & 3 deletions dist/cpdf.browser.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cpdf.browser.min.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions dist/cpdf.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/cpdf.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion server
Original file line number Diff line number Diff line change
@@ -1 +1 @@
http-server
http-server -c-1 -p 8080

0 comments on commit b8e63c0

Please sign in to comment.