Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

brotli-wasm

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brotli-wasm - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

2

package.json
{
"name": "brotli-wasm",
"version": "1.1.0",
"version": "1.1.1",
"description": "A reliable compressor and decompressor for Brotli, supporting node & browsers via wasm",

@@ -5,0 +5,0 @@ "main": "./pkg.node/brotli_wasm.js",

@@ -141,7 +141,12 @@ import * as wasm from './brotli_wasm_bg.wasm';

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.compress(retptr, ptr0, len0, addBorrowedObject(raw_options));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();

@@ -163,7 +168,12 @@ wasm.__wbindgen_free(r0, r1 * 1);

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.decompress(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();

@@ -178,3 +188,3 @@ wasm.__wbindgen_free(r0, r1 * 1);

export function __wbindgen_is_undefined(arg0) {
var ret = getObject(arg0) === undefined;
const ret = getObject(arg0) === undefined;
return ret;

@@ -185,3 +195,3 @@ };

const val = getObject(arg0);
var ret = typeof(val) === 'object' && val !== null;
const ret = typeof(val) === 'object' && val !== null;
return ret;

@@ -191,3 +201,3 @@ };

export function __wbindgen_string_new(arg0, arg1) {
var ret = getStringFromWasm0(arg0, arg1);
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);

@@ -198,5 +208,5 @@ };

const obj = getObject(arg1);
var ret = JSON.stringify(obj === undefined ? null : obj);
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
const ret = JSON.stringify(obj === undefined ? null : obj);
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len0;

@@ -206,11 +216,11 @@ getInt32Memory0()[arg0 / 4 + 0] = ptr0;

export function __wbg_new_59cb74e423758ede() {
var ret = new Error();
export function __wbg_new_693216e109162396() {
const ret = new Error();
return addHeapObject(ret);
};
export function __wbg_stack_558ba5917b466edd(arg0, arg1) {
var ret = getObject(arg1).stack;
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
export function __wbg_stack_0ddaca5d1abfb52f(arg0, arg1) {
const ret = getObject(arg1).stack;
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len0;

@@ -220,3 +230,3 @@ getInt32Memory0()[arg0 / 4 + 0] = ptr0;

export function __wbg_error_4bb6c2a97407129a(arg0, arg1) {
export function __wbg_error_09919627ac0992f5(arg0, arg1) {
try {

@@ -233,5 +243,1 @@ console.error(getStringFromWasm0(arg0, arg1));

export function __wbindgen_rethrow(arg0) {
throw takeObject(arg0);
};

@@ -34,14 +34,2 @@ /* tslint:disable */

export function BrotliEncoderCompressMulti(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number): number;
export function BroccoliCreateInstance(a: number): void;
export function BroccoliCreateInstanceWithWindowSize(a: number, b: number): void;
export function BroccoliDestroyInstance(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, {: number, |: number, }: number, ~: number, : number, €: number, : number, ‚: number, ƒ: number, „: number, …: number, †: number, ‡: number, ˆ: number, ‰: number, Š: number, ‹: number, Œ: number, : number, Ž: number, : number, : number, ‘: number, ’: number, “: number, ”: number, •: number, –: number, —: number, ˜: number, ™: number, š: number, ›: number, œ: number, : number, ž: number, Ÿ: number,  : number, ¡: number, ¢: number, £: number, ¤: number, ¥: number, ¦: number, §: number, ¨: number, ©: number, ª: number, «: number, ¬: number, ­: number, ®: number, ¯: number, °: number, ±: number, ²: number, ³: number, ´: number, µ: number, ¶: number, ·: number, ¸: number, ¹: number, º: number, »: number, ¼: number, ½: number, ¾: number, ¿: number, À: number, Á: number, Â: number, Ã: number, Ä: number, Å: number, Æ: number, Ç: number, È: number, É: number, Ê: number, Ë: number, Ì: number, Í: number, Î: number, Ï: number, Ð: number, Ñ: number, Ò: number, Ó: number, Ô: number, Õ: number, Ö: number, ×: number, Ø: number, Ù: number): void;
export function BroccoliNewBrotliFile(a: number): void;
export function BroccoliConcatStream(a: number, b: number, c: number, d: number, e: number): number;
export function BroccoliConcatStreaming(a: number, b: number, c: number, d: number, e: number): number;
export function BroccoliConcatFinish(a: number, b: number, c: number): number;
export function BroccoliConcatFinished(a: number, b: number, c: number): number;
export function BrotliEncoderMaxCompressedSizeMulti(a: number, b: number): number;
export function BrotliEncoderCreateWorkPool(a: number, b: number, c: number, d: number): number;
export function BrotliEncoderDestroyWorkPool(a: number): void;
export function BrotliEncoderCompressWorkPool(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number): number;
export function BrotliEncoderCreateInstance(a: number, b: number, c: number): number;

@@ -63,2 +51,14 @@ export function BrotliEncoderSetParameter(a: number, b: number, c: number): number;

export function BrotliEncoderFreeUsize(a: number, b: number, c: number): void;
export function BroccoliCreateInstance(a: number): void;
export function BroccoliCreateInstanceWithWindowSize(a: number, b: number): void;
export function BroccoliDestroyInstance(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1: number, v1: number, w1: number, x1: number, y1: number, z1: number, a2: number, b2: number, c2: number, d2: number, e2: number, f2: number, g2: number, h2: number, i2: number, j2: number, k2: number, l2: number, m2: number, n2: number, o2: number, p2: number, q2: number, r2: number, s2: number, t2: number, u2: number, v2: number, w2: number, x2: number, y2: number, z2: number, a3: number, b3: number, c3: number, d3: number, e3: number, f3: number, g3: number, h3: number, i3: number, j3: number, k3: number, l3: number, m3: number, n3: number, o3: number, p3: number, q3: number, r3: number, s3: number, t3: number, u3: number, v3: number, w3: number, x3: number, y3: number, z3: number, a4: number, b4: number, c4: number, d4: number, e4: number, f4: number, g4: number, h4: number, i4: number, j4: number, k4: number, l4: number, m4: number, n4: number, o4: number, p4: number, q4: number): void;
export function BroccoliNewBrotliFile(a: number): void;
export function BroccoliConcatStream(a: number, b: number, c: number, d: number, e: number): number;
export function BroccoliConcatStreaming(a: number, b: number, c: number, d: number, e: number): number;
export function BroccoliConcatFinish(a: number, b: number, c: number): number;
export function BroccoliConcatFinished(a: number, b: number, c: number): number;
export function BrotliEncoderMaxCompressedSizeMulti(a: number, b: number): number;
export function BrotliEncoderCreateWorkPool(a: number, b: number, c: number, d: number): number;
export function BrotliEncoderDestroyWorkPool(a: number): void;
export function BrotliEncoderCompressWorkPool(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number): number;
export function __wbindgen_malloc(a: number): number;

@@ -65,0 +65,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number): number;

@@ -34,14 +34,2 @@ /* tslint:disable */

export function BrotliEncoderCompressMulti(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number): number;
export function BroccoliCreateInstance(a: number): void;
export function BroccoliCreateInstanceWithWindowSize(a: number, b: number): void;
export function BroccoliDestroyInstance(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, {: number, |: number, }: number, ~: number, : number, €: number, : number, ‚: number, ƒ: number, „: number, …: number, †: number, ‡: number, ˆ: number, ‰: number, Š: number, ‹: number, Œ: number, : number, Ž: number, : number, : number, ‘: number, ’: number, “: number, ”: number, •: number, –: number, —: number, ˜: number, ™: number, š: number, ›: number, œ: number, : number, ž: number, Ÿ: number,  : number, ¡: number, ¢: number, £: number, ¤: number, ¥: number, ¦: number, §: number, ¨: number, ©: number, ª: number, «: number, ¬: number, ­: number, ®: number, ¯: number, °: number, ±: number, ²: number, ³: number, ´: number, µ: number, ¶: number, ·: number, ¸: number, ¹: number, º: number, »: number, ¼: number, ½: number, ¾: number, ¿: number, À: number, Á: number, Â: number, Ã: number, Ä: number, Å: number, Æ: number, Ç: number, È: number, É: number, Ê: number, Ë: number, Ì: number, Í: number, Î: number, Ï: number, Ð: number, Ñ: number, Ò: number, Ó: number, Ô: number, Õ: number, Ö: number, ×: number, Ø: number, Ù: number): void;
export function BroccoliNewBrotliFile(a: number): void;
export function BroccoliConcatStream(a: number, b: number, c: number, d: number, e: number): number;
export function BroccoliConcatStreaming(a: number, b: number, c: number, d: number, e: number): number;
export function BroccoliConcatFinish(a: number, b: number, c: number): number;
export function BroccoliConcatFinished(a: number, b: number, c: number): number;
export function BrotliEncoderMaxCompressedSizeMulti(a: number, b: number): number;
export function BrotliEncoderCreateWorkPool(a: number, b: number, c: number, d: number): number;
export function BrotliEncoderDestroyWorkPool(a: number): void;
export function BrotliEncoderCompressWorkPool(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number): number;
export function BrotliEncoderCreateInstance(a: number, b: number, c: number): number;

@@ -63,2 +51,14 @@ export function BrotliEncoderSetParameter(a: number, b: number, c: number): number;

export function BrotliEncoderFreeUsize(a: number, b: number, c: number): void;
export function BroccoliCreateInstance(a: number): void;
export function BroccoliCreateInstanceWithWindowSize(a: number, b: number): void;
export function BroccoliDestroyInstance(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: number, p: number, q: number, r: number, s: number, t: number, u: number, v: number, w: number, x: number, y: number, z: number, a1: number, b1: number, c1: number, d1: number, e1: number, f1: number, g1: number, h1: number, i1: number, j1: number, k1: number, l1: number, m1: number, n1: number, o1: number, p1: number, q1: number, r1: number, s1: number, t1: number, u1: number, v1: number, w1: number, x1: number, y1: number, z1: number, a2: number, b2: number, c2: number, d2: number, e2: number, f2: number, g2: number, h2: number, i2: number, j2: number, k2: number, l2: number, m2: number, n2: number, o2: number, p2: number, q2: number, r2: number, s2: number, t2: number, u2: number, v2: number, w2: number, x2: number, y2: number, z2: number, a3: number, b3: number, c3: number, d3: number, e3: number, f3: number, g3: number, h3: number, i3: number, j3: number, k3: number, l3: number, m3: number, n3: number, o3: number, p3: number, q3: number, r3: number, s3: number, t3: number, u3: number, v3: number, w3: number, x3: number, y3: number, z3: number, a4: number, b4: number, c4: number, d4: number, e4: number, f4: number, g4: number, h4: number, i4: number, j4: number, k4: number, l4: number, m4: number, n4: number, o4: number, p4: number, q4: number): void;
export function BroccoliNewBrotliFile(a: number): void;
export function BroccoliConcatStream(a: number, b: number, c: number, d: number, e: number): number;
export function BroccoliConcatStreaming(a: number, b: number, c: number, d: number, e: number): number;
export function BroccoliConcatFinish(a: number, b: number, c: number): number;
export function BroccoliConcatFinished(a: number, b: number, c: number): number;
export function BrotliEncoderMaxCompressedSizeMulti(a: number, b: number): number;
export function BrotliEncoderCreateWorkPool(a: number, b: number, c: number, d: number): number;
export function BrotliEncoderDestroyWorkPool(a: number): void;
export function BrotliEncoderCompressWorkPool(a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: number): number;
export function __wbindgen_malloc(a: number): number;

@@ -65,0 +65,0 @@ export function __wbindgen_realloc(a: number, b: number, c: number): number;

let imports = {};
imports['__wbindgen_placeholder__'] = module.exports;
let wasm;
const { TextDecoder, TextEncoder } = require(String.raw`util`);
const { TextDecoder, TextEncoder } = require(`util`);

@@ -140,7 +140,12 @@ const heap = new Array(32).fill(undefined);

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.compress(retptr, ptr0, len0, addBorrowedObject(raw_options));
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();

@@ -162,7 +167,12 @@ wasm.__wbindgen_free(r0, r1 * 1);

const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
var ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
var len0 = WASM_VECTOR_LEN;
const ptr0 = passArray8ToWasm0(buf, wasm.__wbindgen_malloc);
const len0 = WASM_VECTOR_LEN;
wasm.decompress(retptr, ptr0, len0);
var r0 = getInt32Memory0()[retptr / 4 + 0];
var r1 = getInt32Memory0()[retptr / 4 + 1];
var r2 = getInt32Memory0()[retptr / 4 + 2];
var r3 = getInt32Memory0()[retptr / 4 + 3];
if (r3) {
throw takeObject(r2);
}
var v1 = getArrayU8FromWasm0(r0, r1).slice();

@@ -177,3 +187,3 @@ wasm.__wbindgen_free(r0, r1 * 1);

module.exports.__wbindgen_is_undefined = function(arg0) {
var ret = getObject(arg0) === undefined;
const ret = getObject(arg0) === undefined;
return ret;

@@ -184,3 +194,3 @@ };

const val = getObject(arg0);
var ret = typeof(val) === 'object' && val !== null;
const ret = typeof(val) === 'object' && val !== null;
return ret;

@@ -190,3 +200,3 @@ };

module.exports.__wbindgen_string_new = function(arg0, arg1) {
var ret = getStringFromWasm0(arg0, arg1);
const ret = getStringFromWasm0(arg0, arg1);
return addHeapObject(ret);

@@ -197,5 +207,5 @@ };

const obj = getObject(arg1);
var ret = JSON.stringify(obj === undefined ? null : obj);
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
const ret = JSON.stringify(obj === undefined ? null : obj);
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len0;

@@ -205,11 +215,11 @@ getInt32Memory0()[arg0 / 4 + 0] = ptr0;

module.exports.__wbg_new_59cb74e423758ede = function() {
var ret = new Error();
module.exports.__wbg_new_693216e109162396 = function() {
const ret = new Error();
return addHeapObject(ret);
};
module.exports.__wbg_stack_558ba5917b466edd = function(arg0, arg1) {
var ret = getObject(arg1).stack;
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
module.exports.__wbg_stack_0ddaca5d1abfb52f = function(arg0, arg1) {
const ret = getObject(arg1).stack;
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
getInt32Memory0()[arg0 / 4 + 1] = len0;

@@ -219,3 +229,3 @@ getInt32Memory0()[arg0 / 4 + 0] = ptr0;

module.exports.__wbg_error_4bb6c2a97407129a = function(arg0, arg1) {
module.exports.__wbg_error_09919627ac0992f5 = function(arg0, arg1) {
try {

@@ -232,6 +242,2 @@ console.error(getStringFromWasm0(arg0, arg1));

module.exports.__wbindgen_rethrow = function(arg0) {
throw takeObject(arg0);
};
const path = require('path').join(__dirname, 'brotli_wasm_bg.wasm');

@@ -238,0 +244,0 @@ const bytes = require('fs').readFileSync(path);

@@ -34,3 +34,3 @@ # brotli-wasm [![Build Status](https://github.com/httptoolkit/brotli-wasm/workflows/CI/badge.svg)](https://github.com/httptoolkit/brotli-wasm/actions) [![Available on NPM](https://img.shields.io/npm/v/brotli-wasm.svg)](https://npmjs.com/package/brotli-wasm)

const compressedData = brotli.compress(Buffer.from('some input'));
const depressedData = brotli.decompress(compressedData);
const decompressedData = brotli.decompress(compressedData);

@@ -48,3 +48,3 @@ console.log(Buffer.from(decompressedData).toString('utf8')); // Prints 'some input'

const compressedData = brotli.compress(Buffer.from('some input'));
const depressedData = brotli.decompress(compressedData);
const decompressedData = brotli.decompress(compressedData);

@@ -64,2 +64,2 @@ console.log(Buffer.from(decompressedData).toString('utf8')); // Prints 'some input'

* [Brotli.js](https://www.npmjs.com/package/brotli) - hand-written JS decompressor that seems to work OK for most cases, but it crashes for some edge cases and the emscripten build of the compressor doesn't work in browsers at all. Last updated in 2017.
* [wasm-brotli](https://www.npmjs.com/package/wasm-brotli) - Compiled from Rust like this package, includes decompressor & compressor, but requires a custom async wrapper for Webpack v4 usage and isn't usable at all in Webpack v5. Last updated in 2019.
* [wasm-brotli](https://www.npmjs.com/package/wasm-brotli) - Compiled from Rust like this package, includes decompressor & compressor, but requires a custom async wrapper for Webpack v4 usage and isn't usable at all in Webpack v5. Last updated in 2019.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc