You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@bytecodealliance/preview2-shim

Package Overview
Dependencies
Maintainers
4
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bytecodealliance/preview2-shim - npm Package Compare versions

Comparing version
0.17.5
to
0.17.6
+0
-1
lib/browser/config.js

@@ -1,2 +0,1 @@

// eslint-disable-next-line no-unused-vars
let _cwd = '/';

@@ -3,0 +2,0 @@

+97
-0

@@ -328,4 +328,101 @@ import { streams } from './io.js';

DirectoryEntryStream,
filesystemErrorCode(err) {
return convertFsError(err.payload);
},
};
function convertFsError(e) {
switch (e.code) {
case 'EACCES':
return 'access';
case 'EAGAIN':
case 'EWOULDBLOCK':
return 'would-block';
case 'EALREADY':
return 'already';
case 'EBADF':
return 'bad-descriptor';
case 'EBUSY':
return 'busy';
case 'EDEADLK':
return 'deadlock';
case 'EDQUOT':
return 'quota';
case 'EEXIST':
return 'exist';
case 'EFBIG':
return 'file-too-large';
case 'EILSEQ':
return 'illegal-byte-sequence';
case 'EINPROGRESS':
return 'in-progress';
case 'EINTR':
return 'interrupted';
case 'EINVAL':
return 'invalid';
case 'EIO':
return 'io';
case 'EISDIR':
return 'is-directory';
case 'ELOOP':
return 'loop';
case 'EMLINK':
return 'too-many-links';
case 'EMSGSIZE':
return 'message-size';
case 'ENAMETOOLONG':
return 'name-too-long';
case 'ENODEV':
return 'no-device';
case 'ENOENT':
return 'no-entry';
case 'ENOLCK':
return 'no-lock';
case 'ENOMEM':
return 'insufficient-memory';
case 'ENOSPC':
return 'insufficient-space';
case 'ENOTDIR':
case 'ERR_FS_EISDIR':
return 'not-directory';
case 'ENOTEMPTY':
return 'not-empty';
case 'ENOTRECOVERABLE':
return 'not-recoverable';
case 'ENOTSUP':
return 'unsupported';
case 'ENOTTY':
return 'no-tty';
// windows gives this error for badly structured `//` reads
// this seems like a slightly better error than unknown given
// that it's a common footgun
case -4094:
case 'ENXIO':
return 'no-such-device';
case 'EOVERFLOW':
return 'overflow';
case 'EPERM':
return 'not-permitted';
case 'EPIPE':
return 'pipe';
case 'EROFS':
return 'read-only';
case 'ESPIPE':
return 'invalid-seek';
case 'ETXTBSY':
return 'text-file-busy';
case 'EXDEV':
return 'cross-device';
case 'UNKNOWN':
switch (e.errno) {
case -4094:
return 'no-such-device';
default:
throw e;
}
default:
throw e;
}
}
export { types as filesystemTypes };

@@ -145,2 +145,12 @@ /**

},
Fields: class Fields {},
FutureIncomingResponse: new class FutureIncomingResponse {},
IncomingBody: new class IncomingBody {},
IncomingRequest: new class IncomingRequest {},
IncomingResponse: new class IncomingResponse {},
OutgoingBody: new class OutgoingBody {},
OutgoingRequest: new class OutgoingRequest {},
OutgoingResponse: new class OutgoingResponse {},
RequestOptions: new class RequestOptions {},
ResponseOutparam: new class ResponseOutparam {},
};

@@ -20,3 +20,3 @@ let id = 0;

* blockingSkip?: (len: BigInt) => BigInt,
* subscribe: () => void,
* subscribe: () => Pollable,
* drop?: () => void,

@@ -37,3 +37,3 @@ * }} InputStreamHandler

* forward?: (src: InputStream) => void,
* subscribe?: () => void,
* subscribe?: () => Pollable,
* drop?: () => void,

@@ -83,2 +83,3 @@ * }} OutputStreamHandler

console.log(`[streams] Subscribe to input stream ${this.id}`);
return new Pollable();
}

@@ -174,2 +175,3 @@ [symbolDispose]() {

console.log(`[streams] Subscribe to output stream ${this.id}`);
return new Pollable();
}

@@ -197,2 +199,3 @@ [symbolDispose]() {}

pollOne,
poll: pollOne,
};
{
"name": "@bytecodealliance/preview2-shim",
"version": "0.17.5",
"version": "0.17.6",
"description": "WASI Preview2 shim for JS environments",

@@ -5,0 +5,0 @@ "author": "Guy Bedford, Eduardo Rodrigues<16357187+eduardomourar@users.noreply.github.com>",