@sebastianwessel/quickjs
Version:
A typescript package to execute JavaScript and TypeScript code in a WebAssembly QuickJS sandbox
18 lines (17 loc) • 481 B
JavaScript
import { call } from '../../helper.js';
import { handleToNative } from '../handleToNative.js';
export const serializeUrl = (ctx, handle) => {
let d;
ctx
.newFunction('', value => {
const v = handleToNative(ctx, value);
d = new URL(v);
})
.consume(f => {
call(ctx, 'internal/serializer/serializeUrl.js', `(d,fn) => {
fn(d.toJSON())
}`, undefined, handle, f).dispose();
});
return d;
};
URLSearchParams;