wasm-rquickjs 0.2.2

Tool for wrapping JavaScript modules as WebAssembly components using the QuickJS engine
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// Mirrors Node.js internal/url isURL() shape check.
// It intentionally avoids instanceof checks so URL-like objects from
// other realms/implementations are recognized the same way as Node does.
export function isURL(value) {
    return Boolean(
        value?.href &&
        value.protocol &&
        value.auth === undefined &&
        value.path === undefined,
    );
}

export default { isURL };