oxigraph
Version:
JavaScript bindings of Oxigraph
1,170 lines (1,058 loc) • 31.5 kB
JavaScript
let imports = {};
imports['__wbindgen_placeholder__'] = module.exports;
let wasm;
const { TextDecoder, TextEncoder } = require(`util`);
let cachedUint8ArrayMemory0 = null;
function getUint8ArrayMemory0() {
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
}
return cachedUint8ArrayMemory0;
}
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
cachedTextDecoder.decode();
function decodeText(ptr, len) {
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
}
function getStringFromWasm0(ptr, len) {
ptr = ptr >>> 0;
return decodeText(ptr, len);
}
function addToExternrefTable0(obj) {
const idx = wasm.__externref_table_alloc();
wasm.__wbindgen_export_2.set(idx, obj);
return idx;
}
function handleError(f, args) {
try {
return f.apply(this, args);
} catch (e) {
const idx = addToExternrefTable0(e);
wasm.__wbindgen_exn_store(idx);
}
}
function getArrayU8FromWasm0(ptr, len) {
ptr = ptr >>> 0;
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
}
let WASM_VECTOR_LEN = 0;
const cachedTextEncoder = new TextEncoder('utf-8');
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
? function (arg, view) {
return cachedTextEncoder.encodeInto(arg, view);
}
: function (arg, view) {
const buf = cachedTextEncoder.encode(arg);
view.set(buf);
return {
read: arg.length,
written: buf.length
};
});
function passStringToWasm0(arg, malloc, realloc) {
if (realloc === undefined) {
const buf = cachedTextEncoder.encode(arg);
const ptr = malloc(buf.length, 1) >>> 0;
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
WASM_VECTOR_LEN = buf.length;
return ptr;
}
let len = arg.length;
let ptr = malloc(len, 1) >>> 0;
const mem = getUint8ArrayMemory0();
let offset = 0;
for (; offset < len; offset++) {
const code = arg.charCodeAt(offset);
if (code > 0x7F) break;
mem[ptr + offset] = code;
}
if (offset !== len) {
if (offset !== 0) {
arg = arg.slice(offset);
}
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
const ret = encodeString(arg, view);
offset += ret.written;
ptr = realloc(ptr, len, offset, 1) >>> 0;
}
WASM_VECTOR_LEN = offset;
return ptr;
}
let cachedDataViewMemory0 = null;
function getDataViewMemory0() {
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
}
return cachedDataViewMemory0;
}
function isLikeNone(x) {
return x === undefined || x === null;
}
function takeFromExternrefTable0(idx) {
const value = wasm.__wbindgen_export_2.get(idx);
wasm.__externref_table_dealloc(idx);
return value;
}
/**
* @param {string} value
* @returns {NamedNode}
*/
module.exports.namedNode = function(value) {
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.namedNode(ptr0, len0);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return NamedNode.__wrap(ret[0]);
};
/**
* @param {string | null} [value]
* @returns {BlankNode}
*/
module.exports.blankNode = function(value) {
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
const ret = wasm.blankNode(ptr0, len0);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return BlankNode.__wrap(ret[0]);
};
/**
* @param {string | null | undefined} value
* @param {any} language_or_datatype
* @returns {Literal}
*/
module.exports.literal = function(value, language_or_datatype) {
var ptr0 = isLikeNone(value) ? 0 : passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len0 = WASM_VECTOR_LEN;
const ret = wasm.literal(ptr0, len0, language_or_datatype);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return Literal.__wrap(ret[0]);
};
/**
* @returns {DefaultGraph}
*/
module.exports.defaultGraph = function() {
const ret = wasm.defaultGraph();
return DefaultGraph.__wrap(ret);
};
/**
* @param {string} value
* @returns {Variable}
*/
module.exports.variable = function(value) {
const ptr0 = passStringToWasm0(value, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.variable(ptr0, len0);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return Variable.__wrap(ret[0]);
};
/**
* @param {any} subject
* @param {any} predicate
* @param {any} object
* @returns {Quad}
*/
module.exports.triple = function(subject, predicate, object) {
const ret = wasm.triple(subject, predicate, object);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return Quad.__wrap(ret[0]);
};
/**
* @param {any} subject
* @param {any} predicate
* @param {any} object
* @param {any} graph
* @returns {Quad}
*/
module.exports.quad = function(subject, predicate, object, graph) {
const ret = wasm.quad(subject, predicate, object, graph);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return Quad.__wrap(ret[0]);
};
/**
* @param {any} original
* @returns {any}
*/
module.exports.fromTerm = function(original) {
const ret = wasm.fromTerm(original);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return takeFromExternrefTable0(ret[0]);
};
/**
* @param {any} original
* @returns {any}
*/
module.exports.fromQuad = function(original) {
const ret = wasm.fromQuad(original);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return takeFromExternrefTable0(ret[0]);
};
function getArrayJsValueFromWasm0(ptr, len) {
ptr = ptr >>> 0;
const mem = getDataViewMemory0();
const result = [];
for (let i = ptr; i < ptr + 4 * len; i += 4) {
result.push(wasm.__wbindgen_export_2.get(mem.getUint32(i, true)));
}
wasm.__externref_drop_slice(ptr, len);
return result;
}
module.exports.main = function() {
wasm.main();
};
const BlankNodeFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_blanknode_free(ptr >>> 0, 1));
class BlankNode {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(BlankNode.prototype);
obj.__wbg_ptr = ptr;
BlankNodeFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
BlankNodeFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_blanknode_free(ptr, 0);
}
/**
* @returns {string}
*/
get termType() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.blanknode_term_type(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
get value() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.blanknode_value(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
toString() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.blanknode_toString(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @param {any} other
* @returns {boolean}
*/
equals(other) {
const ret = wasm.blanknode_equals(this.__wbg_ptr, other);
return ret !== 0;
}
}
module.exports.BlankNode = BlankNode;
const DefaultGraphFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_defaultgraph_free(ptr >>> 0, 1));
class DefaultGraph {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(DefaultGraph.prototype);
obj.__wbg_ptr = ptr;
DefaultGraphFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
DefaultGraphFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_defaultgraph_free(ptr, 0);
}
/**
* @returns {string}
*/
get termType() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.defaultgraph_term_type(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
get value() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.defaultgraph_value(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
toString() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.defaultgraph_toString(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @param {any} other
* @returns {boolean}
*/
equals(other) {
const ret = wasm.defaultgraph_equals(this.__wbg_ptr, other);
return ret !== 0;
}
}
module.exports.DefaultGraph = DefaultGraph;
const LiteralFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_literal_free(ptr >>> 0, 1));
class Literal {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(Literal.prototype);
obj.__wbg_ptr = ptr;
LiteralFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
LiteralFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_literal_free(ptr, 0);
}
/**
* @returns {string}
*/
get termType() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.literal_term_type(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
get value() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.literal_value(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
get language() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.literal_language(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
get direction() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.literal_direction(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {NamedNode}
*/
get datatype() {
const ret = wasm.literal_datatype(this.__wbg_ptr);
return NamedNode.__wrap(ret);
}
/**
* @returns {string}
*/
toString() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.literal_toString(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @param {any} other
* @returns {boolean}
*/
equals(other) {
const ret = wasm.literal_equals(this.__wbg_ptr, other);
return ret !== 0;
}
}
module.exports.Literal = Literal;
const NamedNodeFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_namednode_free(ptr >>> 0, 1));
class NamedNode {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(NamedNode.prototype);
obj.__wbg_ptr = ptr;
NamedNodeFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
NamedNodeFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_namednode_free(ptr, 0);
}
/**
* @returns {string}
*/
get termType() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.namednode_term_type(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
get value() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.namednode_value(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
toString() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.namednode_toString(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @param {any} other
* @returns {boolean}
*/
equals(other) {
const ret = wasm.namednode_equals(this.__wbg_ptr, other);
return ret !== 0;
}
}
module.exports.NamedNode = NamedNode;
const QuadFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_quad_free(ptr >>> 0, 1));
class Quad {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(Quad.prototype);
obj.__wbg_ptr = ptr;
QuadFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
QuadFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_quad_free(ptr, 0);
}
/**
* @returns {string}
*/
get termType() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.quad_term_type(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
get value() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.quad_value(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {any}
*/
get subject() {
const ret = wasm.quad_subject(this.__wbg_ptr);
return ret;
}
/**
* @returns {any}
*/
get predicate() {
const ret = wasm.quad_predicate(this.__wbg_ptr);
return ret;
}
/**
* @returns {any}
*/
get object() {
const ret = wasm.quad_object(this.__wbg_ptr);
return ret;
}
/**
* @returns {any}
*/
get graph() {
const ret = wasm.quad_graph(this.__wbg_ptr);
return ret;
}
/**
* @returns {string}
*/
toString() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.quad_toString(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @param {any} other
* @returns {boolean}
*/
equals(other) {
const ret = wasm.quad_equals(this.__wbg_ptr, other);
return ret !== 0;
}
}
module.exports.Quad = Quad;
const StoreFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_store_free(ptr >>> 0, 1));
class Store {
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
StoreFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_store_free(ptr, 0);
}
/**
* @param {any} quads
*/
constructor(quads) {
const ret = wasm.store_new(quads);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
this.__wbg_ptr = ret[0] >>> 0;
StoreFinalization.register(this, this.__wbg_ptr, this);
return this;
}
/**
* @param {any} quad
*/
add(quad) {
const ret = wasm.store_add(this.__wbg_ptr, quad);
if (ret[1]) {
throw takeFromExternrefTable0(ret[0]);
}
}
/**
* @param {any} quad
*/
delete(quad) {
const ret = wasm.store_delete(this.__wbg_ptr, quad);
if (ret[1]) {
throw takeFromExternrefTable0(ret[0]);
}
}
/**
* @param {any} quad
* @returns {boolean}
*/
has(quad) {
const ret = wasm.store_has(this.__wbg_ptr, quad);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return ret[0] !== 0;
}
/**
* @returns {number}
*/
get size() {
const ret = wasm.store_size(this.__wbg_ptr);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return ret[0] >>> 0;
}
/**
* @param {any} subject
* @param {any} predicate
* @param {any} object
* @param {any} graph_name
* @returns {any[]}
*/
match(subject, predicate, object, graph_name) {
const ret = wasm.store_match(this.__wbg_ptr, subject, predicate, object, graph_name);
if (ret[3]) {
throw takeFromExternrefTable0(ret[2]);
}
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
return v1;
}
/**
* @param {string} query
* @param {any} options
* @returns {any}
*/
query(query, options) {
const ptr0 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.store_query(this.__wbg_ptr, ptr0, len0, options);
if (ret[2]) {
throw takeFromExternrefTable0(ret[1]);
}
return takeFromExternrefTable0(ret[0]);
}
/**
* @param {string} update
* @param {any} options
*/
update(update, options) {
const ptr0 = passStringToWasm0(update, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.store_update(this.__wbg_ptr, ptr0, len0, options);
if (ret[1]) {
throw takeFromExternrefTable0(ret[0]);
}
}
/**
* @param {string} data
* @param {any} options
* @param {any} base_iri
* @param {any} to_graph_name
*/
load(data, options, base_iri, to_graph_name) {
const ptr0 = passStringToWasm0(data, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len0 = WASM_VECTOR_LEN;
const ret = wasm.store_load(this.__wbg_ptr, ptr0, len0, options, base_iri, to_graph_name);
if (ret[1]) {
throw takeFromExternrefTable0(ret[0]);
}
}
/**
* @param {any} options
* @param {any} from_graph_name
* @returns {string}
*/
dump(options, from_graph_name) {
let deferred2_0;
let deferred2_1;
try {
const ret = wasm.store_dump(this.__wbg_ptr, options, from_graph_name);
var ptr1 = ret[0];
var len1 = ret[1];
if (ret[3]) {
ptr1 = 0; len1 = 0;
throw takeFromExternrefTable0(ret[2]);
}
deferred2_0 = ptr1;
deferred2_1 = len1;
return getStringFromWasm0(ptr1, len1);
} finally {
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
}
}
}
module.exports.Store = Store;
const VariableFinalization = (typeof FinalizationRegistry === 'undefined')
? { register: () => {}, unregister: () => {} }
: new FinalizationRegistry(ptr => wasm.__wbg_variable_free(ptr >>> 0, 1));
class Variable {
static __wrap(ptr) {
ptr = ptr >>> 0;
const obj = Object.create(Variable.prototype);
obj.__wbg_ptr = ptr;
VariableFinalization.register(obj, obj.__wbg_ptr, obj);
return obj;
}
__destroy_into_raw() {
const ptr = this.__wbg_ptr;
this.__wbg_ptr = 0;
VariableFinalization.unregister(this);
return ptr;
}
free() {
const ptr = this.__destroy_into_raw();
wasm.__wbg_variable_free(ptr, 0);
}
/**
* @returns {string}
*/
get termType() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.variable_term_type(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
get value() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.variable_value(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @returns {string}
*/
toString() {
let deferred1_0;
let deferred1_1;
try {
const ret = wasm.variable_toString(this.__wbg_ptr);
deferred1_0 = ret[0];
deferred1_1 = ret[1];
return getStringFromWasm0(ret[0], ret[1]);
} finally {
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
}
}
/**
* @param {any} other
* @returns {boolean}
*/
equals(other) {
const ret = wasm.variable_equals(this.__wbg_ptr, other);
return ret !== 0;
}
}
module.exports.Variable = Variable;
module.exports.__wbg_Error_0497d5bdba9362e5 = function(arg0, arg1) {
const ret = Error(getStringFromWasm0(arg0, arg1));
return ret;
};
module.exports.__wbg_blanknode_new = function(arg0) {
const ret = BlankNode.__wrap(arg0);
return ret;
};
module.exports.__wbg_call_fbe8be8bf6436ce5 = function() { return handleError(function (arg0, arg1) {
const ret = arg0.call(arg1);
return ret;
}, arguments) };
module.exports.__wbg_defaultgraph_new = function(arg0) {
const ret = DefaultGraph.__wrap(arg0);
return ret;
};
module.exports.__wbg_done_4d01f352bade43b7 = function(arg0) {
const ret = arg0.done;
return ret;
};
module.exports.__wbg_error_7534b8e9a36f1ab4 = function(arg0, arg1) {
let deferred0_0;
let deferred0_1;
try {
deferred0_0 = arg0;
deferred0_1 = arg1;
console.error(getStringFromWasm0(arg0, arg1));
} finally {
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
}
};
module.exports.__wbg_getRandomValues_3c9c0d586e575a16 = function() { return handleError(function (arg0, arg1) {
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
}, arguments) };
module.exports.__wbg_get_92470be87867c2e5 = function() { return handleError(function (arg0, arg1) {
const ret = Reflect.get(arg0, arg1);
return ret;
}, arguments) };
module.exports.__wbg_has_809e438ee9d787a7 = function() { return handleError(function (arg0, arg1) {
const ret = Reflect.has(arg0, arg1);
return ret;
}, arguments) };
module.exports.__wbg_iterator_4068add5b2aef7a6 = function() {
const ret = Symbol.iterator;
return ret;
};
module.exports.__wbg_literal_new = function(arg0) {
const ret = Literal.__wrap(arg0);
return ret;
};
module.exports.__wbg_namednode_new = function(arg0) {
const ret = NamedNode.__wrap(arg0);
return ret;
};
module.exports.__wbg_new_3ece7e5cee7306c8 = function(arg0, arg1) {
const ret = new URIError(getStringFromWasm0(arg0, arg1));
return ret;
};
module.exports.__wbg_new_476169e6d59f23ae = function(arg0, arg1) {
const ret = new Error(getStringFromWasm0(arg0, arg1));
return ret;
};
module.exports.__wbg_new_58353953ad2097cc = function() {
const ret = new Array();
return ret;
};
module.exports.__wbg_new_8a6f238a6ece86ea = function() {
const ret = new Error();
return ret;
};
module.exports.__wbg_new_a979b4b45bd55c7f = function() {
const ret = new Map();
return ret;
};
module.exports.__wbg_next_8bb824d217961b5d = function(arg0) {
const ret = arg0.next;
return ret;
};
module.exports.__wbg_next_e2da48d8fff7439a = function() { return handleError(function (arg0) {
const ret = arg0.next();
return ret;
}, arguments) };
module.exports.__wbg_now_eb0821f3bd9f6529 = function() {
const ret = Date.now();
return ret;
};
module.exports.__wbg_push_73fd7b5550ebf707 = function(arg0, arg1) {
const ret = arg0.push(arg1);
return ret;
};
module.exports.__wbg_quad_new = function(arg0) {
const ret = Quad.__wrap(arg0);
return ret;
};
module.exports.__wbg_set_d6bdfd275fb8a4ce = function(arg0, arg1, arg2) {
const ret = arg0.set(arg1, arg2);
return ret;
};
module.exports.__wbg_stack_0ed75d68575b0f3c = function(arg0, arg1) {
const ret = arg1.stack;
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
const len1 = WASM_VECTOR_LEN;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
module.exports.__wbg_value_17b896954e14f896 = function(arg0) {
const ret = arg0.value;
return ret;
};
module.exports.__wbg_variable_new = function(arg0) {
const ret = Variable.__wrap(arg0);
return ret;
};
module.exports.__wbg_warn_5504e96f2a60ff63 = function(arg0, arg1) {
console.warn(getStringFromWasm0(arg0, arg1));
};
module.exports.__wbindgen_init_externref_table = function() {
const table = wasm.__wbindgen_export_2;
const offset = table.grow(4);
table.set(0, undefined);
table.set(offset + 0, undefined);
table.set(offset + 1, null);
table.set(offset + 2, true);
table.set(offset + 3, false);
;
};
module.exports.__wbindgen_is_falsy = function(arg0) {
const ret = !arg0;
return ret;
};
module.exports.__wbindgen_is_function = function(arg0) {
const ret = typeof(arg0) === 'function';
return ret;
};
module.exports.__wbindgen_is_null = function(arg0) {
const ret = arg0 === null;
return ret;
};
module.exports.__wbindgen_is_object = function(arg0) {
const val = arg0;
const ret = typeof(val) === 'object' && val !== null;
return ret;
};
module.exports.__wbindgen_is_string = function(arg0) {
const ret = typeof(arg0) === 'string';
return ret;
};
module.exports.__wbindgen_is_undefined = function(arg0) {
const ret = arg0 === undefined;
return ret;
};
module.exports.__wbindgen_string_get = function(arg0, arg1) {
const obj = arg1;
const ret = typeof(obj) === 'string' ? obj : undefined;
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
var len1 = WASM_VECTOR_LEN;
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
};
module.exports.__wbindgen_string_new = function(arg0, arg1) {
const ret = getStringFromWasm0(arg0, arg1);
return ret;
};
module.exports.__wbindgen_throw = function(arg0, arg1) {
throw new Error(getStringFromWasm0(arg0, arg1));
};
const path = require('path').join(__dirname, 'node_bg.wasm');
const bytes = require('fs').readFileSync(path);
const wasmModule = new WebAssembly.Module(bytes);
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
wasm = wasmInstance.exports;
module.exports.__wasm = wasm;
wasm.__wbindgen_start();