@web3api/asyncify-js
Advanced tools
Comparing version 0.0.1-prealpha.84 to 0.0.1-prealpha.85
@@ -161,3 +161,9 @@ "use strict"; | ||
var _this = this; | ||
return utils_1.proxyGet(imports, function (moduleImports) { | ||
return utils_1.proxyGet(imports, function (moduleImports, name) { | ||
if (moduleImports === undefined) { | ||
throw Error("Unsupported wasm import namespace requested: \"" + name + "\"; " + | ||
("Supported wasm import namespaces: " + Object.keys(imports) | ||
.map(function (x) { return "\"" + x + "\""; }) | ||
.join(", "))); | ||
} | ||
return _this._wrapModuleImports(moduleImports); | ||
@@ -168,3 +174,9 @@ }); | ||
var _this = this; | ||
return utils_1.proxyGet(imports, function (importValue) { | ||
return utils_1.proxyGet(imports, function (importValue, name) { | ||
if (importValue === undefined) { | ||
throw Error("Unsupported wasm import requested: \"" + name + "\"; " + | ||
("Supported wasm imports: " + Object.keys(imports) | ||
.map(function (x) { return "\"" + x + "\""; }) | ||
.join(", "))); | ||
} | ||
if (typeof importValue === "function") { | ||
@@ -171,0 +183,0 @@ return _this._wrapImportFn(importValue); |
export declare type MaybeAsync<T> = Promise<T> | T; | ||
export declare function isPromise<T extends unknown>(test?: MaybeAsync<T>): test is Promise<T>; | ||
export declare function proxyGet<T extends Record<string, unknown>>(obj: T, transform: (value: unknown) => unknown): T; | ||
export declare function proxyGet<T extends Record<string, unknown>>(obj: T, transform: (value: unknown, name: string) => unknown): T; | ||
export declare function indexOfArray(source: Uint8Array, search: Uint8Array): number; |
@@ -10,3 +10,5 @@ "use strict"; | ||
return new Proxy(obj, { | ||
get: function (obj, name) { return transform(obj[name]); }, | ||
get: function (obj, name) { | ||
return transform(obj[name], name); | ||
}, | ||
}); | ||
@@ -13,0 +15,0 @@ } |
{ | ||
"name": "@web3api/asyncify-js", | ||
"description": "Async Wasm Imports Support Using Asyncify", | ||
"version": "0.0.1-prealpha.84", | ||
"version": "0.0.1-prealpha.85", | ||
"license": "MIT", | ||
@@ -33,3 +33,3 @@ "repository": { | ||
}, | ||
"gitHead": "17ec161a9d53a58342c8dc85104c7fde5fc867c9", | ||
"gitHead": "3893e530e19fad8a23c452be972e563aff0b0074", | ||
"publishConfig": { | ||
@@ -36,0 +36,0 @@ "access": "public" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24512
360