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

wasm-feature-detect

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wasm-feature-detect - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

255

dist/cjs/index.js

@@ -1,254 +0,1 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var inlineModule =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQMBAAEMAQAKDgEMAEEAQQBBAPwKAAAL";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This function only exists because `WebAssembly.compile` will
// be called quite often and by having our own function terser can give it
// a one-letter name.
async function testCompile(path) {
try {
await WebAssembly.compile(await fetch(path).then(r => r.arrayBuffer()));
return true;
} catch (e) {
return false;
}
}
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index() {
return testCompile(inlineModule);
}
var inlineModule$1 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgAGQAcLCw==";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$1() {
return testCompile(inlineModule$1);
}
var inlineModule$2 =
"data:application/wasm;base64,AGFzbQEAAAABBgFgAAJ/fwMCAQAKCAEGAEEAQQAL";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$2() {
return testCompile(inlineModule$2);
}
var inlineModule$3 =
"data:application/wasm;base64,AGFzbQEAAAACCAEBYQFiA38BBgYBfwFBAAsHBQEBYQMB";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$3() {
return testCompile(inlineModule$3);
}
var inlineModule$4 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBADQGgs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$4() {
return testCompile(inlineModule$4);
}
var inlineModule$5 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgwBCgBDAAAAAPwAGgs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$5() {
return testCompile(inlineModule$5);
}
var inlineModule$6 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgBBAMAaCw==";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$6() {
return testCompile(inlineModule$6);
}
var inlineModule$7 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgkBBwBBAP0EGgs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$7() {
return testCompile(inlineModule$7);
}
var inlineModule$8 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBAASAAs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$8() {
return testCompile(inlineModule$8);
}
var inlineModule$9 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQQBAwEBCgsBCQBBAP4QAgAaCw==";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$9() {
try {
// Test for availability of shared Wasm memory
new WebAssembly.Memory({ initial: 1, maximum: 1, shared: true });
// Test for transferability of SABs (needed for Firefox)
// https://groups.google.com/forum/#!msg/mozilla.dev.platform/IHkBZlHETpA/dwsMNchWEQAJ
await new Promise(resolve => {
const sab = new SharedArrayBuffer(1);
const { port1, port2 } = new MessageChannel();
port2.onmessage = resolve;
port1.postMessage(sab);
});
// Test for atomics
return testCompile(inlineModule$9);
} catch (e) {
return false;
}
}
exports.bulkMemory = index;
exports.exceptions = index$1;
exports.multiValue = index$2;
exports.mutableGlobals = index$3;
exports.referenceTypes = index$4;
exports.saturatedFloatToInt = index$5;
exports.signExtensions = index$6;
exports.simd = index$7;
exports.tailCall = index$8;
exports.threads = index$9;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var A="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQMBAAEMAQAKDgEMAEEAQQBBAPwKAAAL";async function a(A){try{return await WebAssembly.compile(await fetch(A).then(A=>A.arrayBuffer())),!0}catch(A){return!1}}async function t(){return a(A)}var e="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgAGQAcLCw==";async function s(){return a(e)}var n="data:application/wasm;base64,AGFzbQEAAAABBgFgAAJ/fwMCAQAKCAEGAEEAQQAL";async function r(){return a(n)}var B="data:application/wasm;base64,AGFzbQEAAAACCAEBYQFiA38BBgYBfwFBAAsHBQEBYQMB";async function i(){return a(B)}var o="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBADQGgs=";async function c(){return a(o)}var g="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgwBCgBDAAAAAPwAGgs=";async function p(){return a(g)}var u="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgBBAMAaCw==";async function E(){return a(u)}var b="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgkBBwBBAP0EGgs=";async function l(){return a(b)}var w="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBAASAAs=";async function Q(){return a(w)}var m="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQQBAwEBCgsBCQBBAP4QAgAaCw==";async function F(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}),await new Promise(A=>{const a=new SharedArrayBuffer(1),{port1:t,port2:e}=new MessageChannel;e.onmessage=A,t.postMessage(a)}),a(m)}catch(A){return!1}}exports.bulkMemory=t,exports.exceptions=s,exports.multiValue=r,exports.mutableGlobals=i,exports.referenceTypes=c,exports.saturatedFloatToInt=p,exports.signExtensions=E,exports.simd=l,exports.tailCall=Q,exports.threads=F;

@@ -1,252 +0,1 @@

var inlineModule =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQMBAAEMAQAKDgEMAEEAQQBBAPwKAAAL";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This function only exists because `WebAssembly.compile` will
// be called quite often and by having our own function terser can give it
// a one-letter name.
async function testCompile(path) {
try {
await WebAssembly.compile(await fetch(path).then(r => r.arrayBuffer()));
return true;
} catch (e) {
return false;
}
}
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index() {
return testCompile(inlineModule);
}
var inlineModule$1 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgAGQAcLCw==";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$1() {
return testCompile(inlineModule$1);
}
var inlineModule$2 =
"data:application/wasm;base64,AGFzbQEAAAABBgFgAAJ/fwMCAQAKCAEGAEEAQQAL";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$2() {
return testCompile(inlineModule$2);
}
var inlineModule$3 =
"data:application/wasm;base64,AGFzbQEAAAACCAEBYQFiA38BBgYBfwFBAAsHBQEBYQMB";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$3() {
return testCompile(inlineModule$3);
}
var inlineModule$4 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBADQGgs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$4() {
return testCompile(inlineModule$4);
}
var inlineModule$5 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgwBCgBDAAAAAPwAGgs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$5() {
return testCompile(inlineModule$5);
}
var inlineModule$6 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgBBAMAaCw==";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$6() {
return testCompile(inlineModule$6);
}
var inlineModule$7 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgkBBwBBAP0EGgs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$7() {
return testCompile(inlineModule$7);
}
var inlineModule$8 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBAASAAs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$8() {
return testCompile(inlineModule$8);
}
var inlineModule$9 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQQBAwEBCgsBCQBBAP4QAgAaCw==";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$9() {
try {
// Test for availability of shared Wasm memory
new WebAssembly.Memory({ initial: 1, maximum: 1, shared: true });
// Test for transferability of SABs (needed for Firefox)
// https://groups.google.com/forum/#!msg/mozilla.dev.platform/IHkBZlHETpA/dwsMNchWEQAJ
await new Promise(resolve => {
const sab = new SharedArrayBuffer(1);
const { port1, port2 } = new MessageChannel();
port2.onmessage = resolve;
port1.postMessage(sab);
});
// Test for atomics
return testCompile(inlineModule$9);
} catch (e) {
return false;
}
}
export {
index as bulkMemory,
index$1 as exceptions,
index$2 as multiValue,
index$3 as mutableGlobals,
index$4 as referenceTypes,
index$5 as saturatedFloatToInt,
index$6 as signExtensions,
index$7 as simd,
index$8 as tailCall,
index$9 as threads
};
var A="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQMBAAEMAQAKDgEMAEEAQQBBAPwKAAAL";async function a(A){try{return await WebAssembly.compile(await fetch(A).then(A=>A.arrayBuffer())),!0}catch(A){return!1}}async function n(){return a(A)}var s="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgAGQAcLCw==";async function t(){return a(s)}var e="data:application/wasm;base64,AGFzbQEAAAABBgFgAAJ/fwMCAQAKCAEGAEEAQQAL";async function r(){return a(e)}var B="data:application/wasm;base64,AGFzbQEAAAACCAEBYQFiA38BBgYBfwFBAAsHBQEBYQMB";async function i(){return a(B)}var c="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBADQGgs=";async function g(){return a(c)}var o="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgwBCgBDAAAAAPwAGgs=";async function u(){return a(o)}var E="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgBBAMAaCw==";async function b(){return a(E)}var p="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgkBBwBBAP0EGgs=";async function w(){return a(p)}var Q="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBAASAAs=";async function l(){return a(Q)}var m="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQQBAwEBCgsBCQBBAP4QAgAaCw==";async function F(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}),await new Promise(A=>{const a=new SharedArrayBuffer(1),{port1:n,port2:s}=new MessageChannel;s.onmessage=A,n.postMessage(a)}),a(m)}catch(A){return!1}}export{n as bulkMemory,t as exceptions,r as multiValue,i as mutableGlobals,g as referenceTypes,u as saturatedFloatToInt,b as signExtensions,w as simd,l as tailCall,F as threads};

@@ -1,262 +0,1 @@

(function(global, factory) {
typeof exports === "object" && typeof module !== "undefined"
? factory(exports)
: typeof define === "function" && define.amd
? define(["exports"], factory)
: ((global = global || self), factory((global.wasmFeatureDetect = {})));
})(this, function(exports) {
"use strict";
var inlineModule =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQMBAAEMAQAKDgEMAEEAQQBBAPwKAAAL";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// This function only exists because `WebAssembly.compile` will
// be called quite often and by having our own function terser can give it
// a one-letter name.
async function testCompile(path) {
try {
await WebAssembly.compile(await fetch(path).then(r => r.arrayBuffer()));
return true;
} catch (e) {
return false;
}
}
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index() {
return testCompile(inlineModule);
}
var inlineModule$1 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgAGQAcLCw==";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$1() {
return testCompile(inlineModule$1);
}
var inlineModule$2 =
"data:application/wasm;base64,AGFzbQEAAAABBgFgAAJ/fwMCAQAKCAEGAEEAQQAL";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$2() {
return testCompile(inlineModule$2);
}
var inlineModule$3 =
"data:application/wasm;base64,AGFzbQEAAAACCAEBYQFiA38BBgYBfwFBAAsHBQEBYQMB";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$3() {
return testCompile(inlineModule$3);
}
var inlineModule$4 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBADQGgs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$4() {
return testCompile(inlineModule$4);
}
var inlineModule$5 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgwBCgBDAAAAAPwAGgs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$5() {
return testCompile(inlineModule$5);
}
var inlineModule$6 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgBBAMAaCw==";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$6() {
return testCompile(inlineModule$6);
}
var inlineModule$7 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgkBBwBBAP0EGgs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$7() {
return testCompile(inlineModule$7);
}
var inlineModule$8 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBAASAAs=";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$8() {
return testCompile(inlineModule$8);
}
var inlineModule$9 =
"data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQQBAwEBCgsBCQBBAP4QAgAaCw==";
/**
* Copyright 2019 Google Inc. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
async function index$9() {
try {
// Test for availability of shared Wasm memory
new WebAssembly.Memory({ initial: 1, maximum: 1, shared: true });
// Test for transferability of SABs (needed for Firefox)
// https://groups.google.com/forum/#!msg/mozilla.dev.platform/IHkBZlHETpA/dwsMNchWEQAJ
await new Promise(resolve => {
const sab = new SharedArrayBuffer(1);
const { port1, port2 } = new MessageChannel();
port2.onmessage = resolve;
port1.postMessage(sab);
});
// Test for atomics
return testCompile(inlineModule$9);
} catch (e) {
return false;
}
}
exports.bulkMemory = index;
exports.exceptions = index$1;
exports.multiValue = index$2;
exports.mutableGlobals = index$3;
exports.referenceTypes = index$4;
exports.saturatedFloatToInt = index$5;
exports.signExtensions = index$6;
exports.simd = index$7;
exports.tailCall = index$8;
exports.threads = index$9;
Object.defineProperty(exports, "__esModule", { value: true });
});
!function(A,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports):"function"==typeof define&&define.amd?define(["exports"],a):a((A=A||self).wasmFeatureDetect={})}(this,function(A){"use strict";var a="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQMBAAEMAQAKDgEMAEEAQQBBAPwKAAAL";async function e(A){try{return await WebAssembly.compile(await fetch(A).then(A=>A.arrayBuffer())),!0}catch(A){return!1}}var t="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgAGQAcLCw==";var n="data:application/wasm;base64,AGFzbQEAAAABBgFgAAJ/fwMCAQAKCAEGAEEAQQAL";var s="data:application/wasm;base64,AGFzbQEAAAACCAEBYQFiA38BBgYBfwFBAAsHBQEBYQMB";var r="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBADQGgs=";var i="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgwBCgBDAAAAAPwAGgs=";var B="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACggBBgBBAMAaCw==";var c="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgkBBwBBAP0EGgs=";var o="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEACgYBBAASAAs=";var u="data:application/wasm;base64,AGFzbQEAAAABBAFgAAADAgEABQQBAwEBCgsBCQBBAP4QAgAaCw==";A.bulkMemory=async function(){return e(a)},A.exceptions=async function(){return e(t)},A.multiValue=async function(){return e(n)},A.mutableGlobals=async function(){return e(s)},A.referenceTypes=async function(){return e(r)},A.saturatedFloatToInt=async function(){return e(i)},A.signExtensions=async function(){return e(B)},A.simd=async function(){return e(c)},A.tailCall=async function(){return e(o)},A.threads=async function(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}),await new Promise(A=>{const a=new SharedArrayBuffer(1),{port1:e,port2:t}=new MessageChannel;t.onmessage=A,e.postMessage(a)}),e(u)}catch(A){return!1}},Object.defineProperty(A,"__esModule",{value:!0})});

4

package.json
{
"name": "wasm-feature-detect",
"version": "1.0.0",
"version": "1.0.1",
"description": "A small library (700B gzip’d) to detect which features of WebAssembly are supported in your current browser.",

@@ -11,3 +11,3 @@ "main": "dist/cjs/index.js",

"build": "npm run build:library && npm run build:readme",
"fmt": "prettier --write './{,src,rollup-plugins}/**/*.{mjs,js,md}'"
"fmt": "prettier --write './{,{src,rollup-plugins}/**/}*.{mjs,js,md}'"
},

@@ -14,0 +14,0 @@ "repository": "GoogleChromeLabs/wasm-feature-detect",

@@ -53,12 +53,4 @@ # WebAssembly Feature Detection

## Why are all the tests async?
The _technical_ reason is that some tests might have to be augmented to be asynchronous in the future. For example, Firefox is planning to [make a change][ff coop] that would require a `postMessage` call to detect SABs, which are required for threads.
The _other_ reason is that you _should_ be using `WebAssembly.compile`, `WebAssembly.instantiate`, or their streaming versions `WebAssembly.compileStreaming` and `WebAssembly.instantiateStreaming`, which are all asynchronous. You should already be prepared for asynchronous code when using WebAssembly!
[ff coop]: https://groups.google.com/forum/#!msg/mozilla.dev.platform/IHkBZlHETpA/dwsMNchWEQAJ
---
License Apache-2.0
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