mq-web 0.2.7 → 0.2.8-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var k=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var J=(e,t)=>()=>(e&&(t=e(e=0)),t);var R=(e,t)=>{for(var n in t)k(e,n,{get:t[n],enumerable:!0})},G=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of C(t))!H.call(e,i)&&i!==n&&k(e,i,{get:()=>t[i],enumerable:!(r=N(t,i))||r.enumerable});return e};var K=e=>G(k({},"__esModule",{value:!0}),e);var $={};R($,{RunOptions:()=>V,default:()=>E,definedValues:()=>te,diagnostics:()=>ee,format:()=>Z,initSync:()=>ie,run:()=>Y});function s(e){return w[e]}function j(){return(x===null||x.byteLength===0)&&(x=new Uint8Array(o.memory.buffer)),x}function y(e,t,n){if(n===void 0){let f=O.encode(e),b=t(f.length,1)>>>0;return j().subarray(b,b+f.length).set(f),g=f.length,b}let r=e.length,i=t(r,1)>>>0,a=j(),c=0;for(;c<r;c++){let f=e.charCodeAt(c);if(f>127)break;a[i+c]=f}if(c!==r){c!==0&&(e=e.slice(c)),i=n(i,r,r=c+e.length*3,1)>>>0;let f=j().subarray(i+c,i+r),b=Q(e,f);c+=b.written,i=n(i,r,c,1)>>>0}return g=c,i}function _(){return(m===null||m.buffer.detached===!0||m.buffer.detached===void 0&&m.buffer!==o.memory.buffer)&&(m=new DataView(o.memory.buffer)),m}function u(e){A===w.length&&w.push(w.length+1);let t=A;return A=w[t],w[t]=e,t}function X(e){e<132||(w[e]=A,A=e)}function l(e){let t=s(e);return X(e),t}function D(e){let t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){let i=e.description;return i==null?"Symbol":`Symbol(${i})`}if(t=="function"){let i=e.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(e)){let i=e.length,a="[";i>0&&(a+=D(e[0]));for(let c=1;c<i;c++)a+=", "+D(e[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
2
- ${e.stack}`:r}function I(e,t){return e=e>>>0,F.decode(j().subarray(e,e+t))}function M(e){return e==null}function Y(e,t,n){let r,i;try{let p=o.__wbindgen_add_to_stack_pointer(-16),z=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),L=g,q=y(t,o.__wbindgen_export_0,o.__wbindgen_export_1),B=g;o.run(p,z,L,q,B,u(n));var a=_().getInt32(p+4*0,!0),c=_().getInt32(p+4*1,!0),f=_().getInt32(p+4*2,!0),b=_().getInt32(p+4*3,!0),d=a,h=c;if(b)throw d=0,h=0,l(f);return r=d,i=h,I(d,h)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(r,i,1)}}function Z(e){let t,n;try{let d=o.__wbindgen_add_to_stack_pointer(-16),h=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),p=g;o.format(d,h,p);var r=_().getInt32(d+4*0,!0),i=_().getInt32(d+4*1,!0),a=_().getInt32(d+4*2,!0),c=_().getInt32(d+4*3,!0),f=r,b=i;if(c)throw f=0,b=0,l(a);return t=f,n=b,I(f,b)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(t,n,1)}}function ee(e){let t=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),n=g,r=o.diagnostics(t,n);return l(r)}function te(e){try{let i=o.__wbindgen_add_to_stack_pointer(-16),a=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),c=g;o.definedValues(i,a,c);var t=_().getInt32(i+4*0,!0),n=_().getInt32(i+4*1,!0),r=_().getInt32(i+4*2,!0);if(r)throw l(n);return l(t)}finally{o.__wbindgen_add_to_stack_pointer(16)}}async function re(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function U(){let e={};return e.wbg={},e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,n){let r=String(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=g;_().setInt32(t+4*1,a,!0),_().setInt32(t+4*0,i,!0)},e.wbg.__wbg_buffer_609cc3eee51ed158=function(t){let n=s(t).buffer;return u(n)},e.wbg.__wbg_entries_3265d4158b33e5dc=function(t){let n=Object.entries(s(t));return u(n)},e.wbg.__wbg_get_b9b93047fe3cf45b=function(t,n){let r=s(t)[n>>>0];return u(r)},e.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(t,n){let r=s(t)[s(n)];return u(r)},e.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(t){let n;try{n=s(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(t){let n;try{n=s(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_length_a446193dc22c12f8=function(t){return s(t).length},e.wbg.__wbg_length_e2d2a49132c1b256=function(t){return s(t).length},e.wbg.__wbg_new_405e22f390576ce2=function(){let t=new Object;return u(t)},e.wbg.__wbg_new_78feb108b6472713=function(){let t=new Array;return u(t)},e.wbg.__wbg_new_a12002a7f91c75be=function(t){let n=new Uint8Array(s(t));return u(n)},e.wbg.__wbg_set_37837023f3d740e8=function(t,n,r){s(t)[n>>>0]=l(r)},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,n,r){s(t)[l(n)]=l(r)},e.wbg.__wbg_set_65595bdd868b3009=function(t,n,r){s(t).set(s(n),r>>>0)},e.wbg.__wbindgen_boolean_get=function(t){let n=s(t);return typeof n=="boolean"?n?1:0:2},e.wbg.__wbindgen_debug_string=function(t,n){let r=D(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=g;_().setInt32(t+4*1,a,!0),_().setInt32(t+4*0,i,!0)},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(I(t,n));return u(r)},e.wbg.__wbindgen_in=function(t,n){return s(t)in s(n)},e.wbg.__wbindgen_is_object=function(t){let n=s(t);return typeof n=="object"&&n!==null},e.wbg.__wbindgen_is_string=function(t){return typeof s(t)=="string"},e.wbg.__wbindgen_is_undefined=function(t){return s(t)===void 0},e.wbg.__wbindgen_jsval_loose_eq=function(t,n){return s(t)==s(n)},e.wbg.__wbindgen_memory=function(){let t=o.memory;return u(t)},e.wbg.__wbindgen_number_get=function(t,n){let r=s(n),i=typeof r=="number"?r:void 0;_().setFloat64(t+8*1,M(i)?0:i,!0),_().setInt32(t+4*0,!M(i),!0)},e.wbg.__wbindgen_number_new=function(t){return u(t)},e.wbg.__wbindgen_object_clone_ref=function(t){let n=s(t);return u(n)},e.wbg.__wbindgen_object_drop_ref=function(t){l(t)},e.wbg.__wbindgen_string_get=function(t,n){let r=s(n),i=typeof r=="string"?r:void 0;var a=M(i)?0:y(i,o.__wbindgen_export_0,o.__wbindgen_export_1),c=g;_().setInt32(t+4*1,c,!0),_().setInt32(t+4*0,a,!0)},e.wbg.__wbindgen_string_new=function(t,n){let r=I(t,n);return u(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(I(t,n))},e}function v(e,t){return o=e.exports,P.__wbindgen_wasm_module=t,m=null,x=null,o}function ie(e){if(o!==void 0)return o;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=U();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return v(n,e)}async function P(e){if(o!==void 0)return o;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("mq_wasm_bg.wasm",oe.url));let t=U();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await re(await e,t);return v(n,r)}var oe,o,w,g,x,O,Q,m,A,F,ne,V,E,T=J(()=>{"use strict";oe={},w=new Array(128).fill(void 0);w.push(void 0,null,!0,!1);g=0,x=null;O=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Q=typeof O.encodeInto=="function"?function(e,t){return O.encodeInto(e,t)}:function(e,t){let n=O.encode(e);return t.set(n),{read:e.length,written:n.length}};m=null;A=w.length;F=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&F.decode();ne=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>o.__wbg_runoptions_free(e>>>0,1)),V=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,ne.unregister(this),t}free(){let t=this.__destroy_into_raw();o.__wbg_runoptions_free(t,0)}};E=P});var fe={};R(fe,{definedValues:()=>ae,diagnostics:()=>_e,format:()=>ce,run:()=>se});module.exports=K(fe);T();var S=null;async function W(){return S||(await(async()=>{try{await E();let e=await Promise.resolve().then(()=>(T(),$));S={run:e.run,format:e.format,diagnostics:e.diagnostics,definedValues:e.definedValues}}catch(e){throw new Error(`Failed to initialize mq WebAssembly module: ${e}`)}})(),S)}async function se(e,t,n={}){return await(await W()).run(e,t,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function ce(e){return await(await W()).format(e)}async function _e(e){return await(await W()).diagnostics(e)}async function ae(e){return await(await W()).definedValues(e)}0&&(module.exports={definedValues,diagnostics,format,run});
1
+ "use strict";var k=Object.defineProperty;var N=Object.getOwnPropertyDescriptor;var C=Object.getOwnPropertyNames;var H=Object.prototype.hasOwnProperty;var J=(t,e)=>()=>(t&&(e=t(t=0)),e);var T=(t,e)=>{for(var n in e)k(t,n,{get:e[n],enumerable:!0})},G=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of C(e))!H.call(t,i)&&i!==n&&k(t,i,{get:()=>e[i],enumerable:!(r=N(e,i))||r.enumerable});return t};var K=t=>G(k({},"__esModule",{value:!0}),t);var $={};T($,{RunOptions:()=>D,default:()=>V,definedValues:()=>nt,diagnostics:()=>et,format:()=>tt,initSync:()=>ot,run:()=>Y,toAst:()=>Z});function s(t){return y[t]}function O(){return(A===null||A.byteLength===0)&&(A=new Uint8Array(o.memory.buffer)),A}function p(t,e,n){if(n===void 0){let f=S.encode(t),u=e(f.length,1)>>>0;return O().subarray(u,u+f.length).set(f),b=f.length,u}let r=t.length,i=e(r,1)>>>0,a=O(),c=0;for(;c<r;c++){let f=t.charCodeAt(c);if(f>127)break;a[i+c]=f}if(c!==r){c!==0&&(t=t.slice(c)),i=n(i,r,r=c+t.length*3,1)>>>0;let f=O().subarray(i+c,i+r),u=Q(t,f);c+=u.written,i=n(i,r,c,1)>>>0}return b=c,i}function _(){return(h===null||h.buffer.detached===!0||h.buffer.detached===void 0&&h.buffer!==o.memory.buffer)&&(h=new DataView(o.memory.buffer)),h}function d(t){I===y.length&&y.push(y.length+1);let e=I;return I=y[e],y[e]=t,e}function X(t){t<132||(y[t]=I,I=t)}function w(t){let e=s(t);return X(t),e}function M(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){let i=t.length,a="[";i>0&&(a+=M(t[0]));for(let c=1;c<i;c++)a+=", "+M(t[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(t)),r;if(n&&n.length>1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
2
+ ${t.stack}`:r}function x(t,e){return t=t>>>0,R.decode(O().subarray(t,t+e))}function v(t){return t==null}function Y(t,e,n){let r,i;try{let l=o.__wbindgen_add_to_stack_pointer(-16),z=p(t,o.__wbindgen_export_0,o.__wbindgen_export_1),L=b,q=p(e,o.__wbindgen_export_0,o.__wbindgen_export_1),B=b;o.run(l,z,L,q,B,d(n));var a=_().getInt32(l+4*0,!0),c=_().getInt32(l+4*1,!0),f=_().getInt32(l+4*2,!0),u=_().getInt32(l+4*3,!0),g=a,m=c;if(u)throw g=0,m=0,w(f);return r=g,i=m,x(g,m)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(r,i,1)}}function Z(t){let e,n;try{let g=o.__wbindgen_add_to_stack_pointer(-16),m=p(t,o.__wbindgen_export_0,o.__wbindgen_export_1),l=b;o.toAst(g,m,l);var r=_().getInt32(g+4*0,!0),i=_().getInt32(g+4*1,!0),a=_().getInt32(g+4*2,!0),c=_().getInt32(g+4*3,!0),f=r,u=i;if(c)throw f=0,u=0,w(a);return e=f,n=u,x(f,u)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(e,n,1)}}function tt(t){let e,n;try{let g=o.__wbindgen_add_to_stack_pointer(-16),m=p(t,o.__wbindgen_export_0,o.__wbindgen_export_1),l=b;o.format(g,m,l);var r=_().getInt32(g+4*0,!0),i=_().getInt32(g+4*1,!0),a=_().getInt32(g+4*2,!0),c=_().getInt32(g+4*3,!0),f=r,u=i;if(c)throw f=0,u=0,w(a);return e=f,n=u,x(f,u)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(e,n,1)}}function et(t){let e=p(t,o.__wbindgen_export_0,o.__wbindgen_export_1),n=b,r=o.diagnostics(e,n);return w(r)}function nt(t){try{let i=o.__wbindgen_add_to_stack_pointer(-16),a=p(t,o.__wbindgen_export_0,o.__wbindgen_export_1),c=b;o.definedValues(i,a,c);var e=_().getInt32(i+4*0,!0),n=_().getInt32(i+4*1,!0),r=_().getInt32(i+4*2,!0);if(r)throw w(n);return w(e)}finally{o.__wbindgen_add_to_stack_pointer(16)}}async function it(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{let n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function F(){let t={};return t.wbg={},t.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){let r=String(s(n)),i=p(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=b;_().setInt32(e+4*1,a,!0),_().setInt32(e+4*0,i,!0)},t.wbg.__wbg_buffer_609cc3eee51ed158=function(e){let n=s(e).buffer;return d(n)},t.wbg.__wbg_entries_3265d4158b33e5dc=function(e){let n=Object.entries(s(e));return d(n)},t.wbg.__wbg_get_b9b93047fe3cf45b=function(e,n){let r=s(e)[n>>>0];return d(r)},t.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(e,n){let r=s(e)[s(n)];return d(r)},t.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(e){let n;try{n=s(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(e){let n;try{n=s(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_length_a446193dc22c12f8=function(e){return s(e).length},t.wbg.__wbg_length_e2d2a49132c1b256=function(e){return s(e).length},t.wbg.__wbg_new_405e22f390576ce2=function(){let e=new Object;return d(e)},t.wbg.__wbg_new_78feb108b6472713=function(){let e=new Array;return d(e)},t.wbg.__wbg_new_a12002a7f91c75be=function(e){let n=new Uint8Array(s(e));return d(n)},t.wbg.__wbg_set_37837023f3d740e8=function(e,n,r){s(e)[n>>>0]=w(r)},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,r){s(e)[w(n)]=w(r)},t.wbg.__wbg_set_65595bdd868b3009=function(e,n,r){s(e).set(s(n),r>>>0)},t.wbg.__wbindgen_boolean_get=function(e){let n=s(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbindgen_debug_string=function(e,n){let r=M(s(n)),i=p(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=b;_().setInt32(e+4*1,a,!0),_().setInt32(e+4*0,i,!0)},t.wbg.__wbindgen_error_new=function(e,n){let r=new Error(x(e,n));return d(r)},t.wbg.__wbindgen_in=function(e,n){return s(e)in s(n)},t.wbg.__wbindgen_is_object=function(e){let n=s(e);return typeof n=="object"&&n!==null},t.wbg.__wbindgen_is_string=function(e){return typeof s(e)=="string"},t.wbg.__wbindgen_is_undefined=function(e){return s(e)===void 0},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return s(e)==s(n)},t.wbg.__wbindgen_memory=function(){let e=o.memory;return d(e)},t.wbg.__wbindgen_number_get=function(e,n){let r=s(n),i=typeof r=="number"?r:void 0;_().setFloat64(e+8*1,v(i)?0:i,!0),_().setInt32(e+4*0,!v(i),!0)},t.wbg.__wbindgen_number_new=function(e){return d(e)},t.wbg.__wbindgen_object_clone_ref=function(e){let n=s(e);return d(n)},t.wbg.__wbindgen_object_drop_ref=function(e){w(e)},t.wbg.__wbindgen_string_get=function(e,n){let r=s(n),i=typeof r=="string"?r:void 0;var a=v(i)?0:p(i,o.__wbindgen_export_0,o.__wbindgen_export_1),c=b;_().setInt32(e+4*1,c,!0),_().setInt32(e+4*0,a,!0)},t.wbg.__wbindgen_string_new=function(e,n){let r=x(e,n);return d(r)},t.wbg.__wbindgen_throw=function(e,n){throw new Error(x(e,n))},t}function U(t,e){return o=t.exports,P.__wbindgen_wasm_module=e,h=null,A=null,o}function ot(t){if(o!==void 0)return o;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=F();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let n=new WebAssembly.Instance(t,e);return U(n,t)}async function P(t){if(o!==void 0)return o;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("mq_wasm_bg.wasm",st.url));let e=F();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:r}=await it(await t,e);return U(n,r)}var st,o,y,b,A,S,Q,h,I,R,rt,D,V,E=J(()=>{"use strict";st={},y=new Array(128).fill(void 0);y.push(void 0,null,!0,!1);b=0,A=null;S=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},Q=typeof S.encodeInto=="function"?function(t,e){return S.encodeInto(t,e)}:function(t,e){let n=S.encode(t);return e.set(n),{read:t.length,written:n.length}};h=null;I=y.length;R=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&R.decode();rt=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>o.__wbg_runoptions_free(t>>>0,1)),D=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,rt.unregister(this),e}free(){let e=this.__destroy_into_raw();o.__wbg_runoptions_free(e,0)}};V=P});var gt={};T(gt,{definedValues:()=>ut,diagnostics:()=>ft,format:()=>at,run:()=>ct,toAst:()=>_t});module.exports=K(gt);E();var W=null;async function j(){return W||(await(async()=>{try{await V();let t=await Promise.resolve().then(()=>(E(),$));W={run:t.run,toAst:t.toAst,format:t.format,diagnostics:t.diagnostics,definedValues:t.definedValues}}catch(t){throw new Error(`Failed to initialize mq WebAssembly module: ${t}`)}})(),W)}async function ct(t,e,n={}){return await(await j()).run(t,e,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function _t(t){return await(await j()).toAst(t)}async function at(t){return await(await j()).format(t)}async function ft(t){return await(await j()).diagnostics(t)}async function ut(t){return await(await j()).definedValues(t)}0&&(module.exports={definedValues,diagnostics,format,run,toAst});
package/dist/core.d.cts CHANGED
@@ -27,6 +27,10 @@ interface Options {
27
27
  * Run an mq
28
28
  */
29
29
  declare function run(code: string, content: string, options?: Partial<Options>): Promise<string>;
30
+ /**
31
+ * Convert mq code to its AST (Abstract Syntax Tree) representation.
32
+ */
33
+ declare function toAst(code: string): Promise<string>;
30
34
  /**
31
35
  * Format mq code
32
36
  */
@@ -40,4 +44,4 @@ declare function diagnostics(code: string): Promise<ReadonlyArray<Diagnostic>>;
40
44
  */
41
45
  declare function definedValues(code: string): Promise<ReadonlyArray<DefinedValue>>;
42
46
 
43
- export { definedValues, diagnostics, format, run };
47
+ export { definedValues, diagnostics, format, run, toAst };
package/dist/core.d.ts CHANGED
@@ -27,6 +27,10 @@ interface Options {
27
27
  * Run an mq
28
28
  */
29
29
  declare function run(code: string, content: string, options?: Partial<Options>): Promise<string>;
30
+ /**
31
+ * Convert mq code to its AST (Abstract Syntax Tree) representation.
32
+ */
33
+ declare function toAst(code: string): Promise<string>;
30
34
  /**
31
35
  * Format mq code
32
36
  */
@@ -40,4 +44,4 @@ declare function diagnostics(code: string): Promise<ReadonlyArray<Diagnostic>>;
40
44
  */
41
45
  declare function definedValues(code: string): Promise<ReadonlyArray<DefinedValue>>;
42
46
 
43
- export { definedValues, diagnostics, format, run };
47
+ export { definedValues, diagnostics, format, run, toAst };
package/dist/core.js CHANGED
@@ -1,2 +1,2 @@
1
- var q=Object.defineProperty;var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var N=(e,t)=>{for(var n in t)q(e,n,{get:t[n],enumerable:!0})};var v={};N(v,{RunOptions:()=>D,default:()=>V,definedValues:()=>Q,diagnostics:()=>K,format:()=>G,initSync:()=>Z,run:()=>J});function s(e){return w[e]}function j(){return(x===null||x.byteLength===0)&&(x=new Uint8Array(o.memory.buffer)),x}function y(e,t,n){if(n===void 0){let f=O.encode(e),b=t(f.length,1)>>>0;return j().subarray(b,b+f.length).set(f),g=f.length,b}let r=e.length,i=t(r,1)>>>0,a=j(),c=0;for(;c<r;c++){let f=e.charCodeAt(c);if(f>127)break;a[i+c]=f}if(c!==r){c!==0&&(e=e.slice(c)),i=n(i,r,r=c+e.length*3,1)>>>0;let f=j().subarray(i+c,i+r),b=C(e,f);c+=b.written,i=n(i,r,c,1)>>>0}return g=c,i}function _(){return(m===null||m.buffer.detached===!0||m.buffer.detached===void 0&&m.buffer!==o.memory.buffer)&&(m=new DataView(o.memory.buffer)),m}function u(e){A===w.length&&w.push(w.length+1);let t=A;return A=w[t],w[t]=e,t}function H(e){e<132||(w[e]=A,A=e)}function l(e){let t=s(e);return H(e),t}function M(e){let t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){let i=e.description;return i==null?"Symbol":`Symbol(${i})`}if(t=="function"){let i=e.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(e)){let i=e.length,a="[";i>0&&(a+=M(e[0]));for(let c=1;c<i;c++)a+=", "+M(e[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
2
- ${e.stack}`:r}function I(e,t){return e=e>>>0,T.decode(j().subarray(e,e+t))}function k(e){return e==null}function J(e,t,n){let r,i;try{let p=o.__wbindgen_add_to_stack_pointer(-16),P=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),$=g,z=y(t,o.__wbindgen_export_0,o.__wbindgen_export_1),L=g;o.run(p,P,$,z,L,u(n));var a=_().getInt32(p+4*0,!0),c=_().getInt32(p+4*1,!0),f=_().getInt32(p+4*2,!0),b=_().getInt32(p+4*3,!0),d=a,h=c;if(b)throw d=0,h=0,l(f);return r=d,i=h,I(d,h)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(r,i,1)}}function G(e){let t,n;try{let d=o.__wbindgen_add_to_stack_pointer(-16),h=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),p=g;o.format(d,h,p);var r=_().getInt32(d+4*0,!0),i=_().getInt32(d+4*1,!0),a=_().getInt32(d+4*2,!0),c=_().getInt32(d+4*3,!0),f=r,b=i;if(c)throw f=0,b=0,l(a);return t=f,n=b,I(f,b)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(t,n,1)}}function K(e){let t=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),n=g,r=o.diagnostics(t,n);return l(r)}function Q(e){try{let i=o.__wbindgen_add_to_stack_pointer(-16),a=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),c=g;o.definedValues(i,a,c);var t=_().getInt32(i+4*0,!0),n=_().getInt32(i+4*1,!0),r=_().getInt32(i+4*2,!0);if(r)throw l(n);return l(t)}finally{o.__wbindgen_add_to_stack_pointer(16)}}async function Y(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function R(){let e={};return e.wbg={},e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,n){let r=String(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=g;_().setInt32(t+4*1,a,!0),_().setInt32(t+4*0,i,!0)},e.wbg.__wbg_buffer_609cc3eee51ed158=function(t){let n=s(t).buffer;return u(n)},e.wbg.__wbg_entries_3265d4158b33e5dc=function(t){let n=Object.entries(s(t));return u(n)},e.wbg.__wbg_get_b9b93047fe3cf45b=function(t,n){let r=s(t)[n>>>0];return u(r)},e.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(t,n){let r=s(t)[s(n)];return u(r)},e.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(t){let n;try{n=s(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(t){let n;try{n=s(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_length_a446193dc22c12f8=function(t){return s(t).length},e.wbg.__wbg_length_e2d2a49132c1b256=function(t){return s(t).length},e.wbg.__wbg_new_405e22f390576ce2=function(){let t=new Object;return u(t)},e.wbg.__wbg_new_78feb108b6472713=function(){let t=new Array;return u(t)},e.wbg.__wbg_new_a12002a7f91c75be=function(t){let n=new Uint8Array(s(t));return u(n)},e.wbg.__wbg_set_37837023f3d740e8=function(t,n,r){s(t)[n>>>0]=l(r)},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,n,r){s(t)[l(n)]=l(r)},e.wbg.__wbg_set_65595bdd868b3009=function(t,n,r){s(t).set(s(n),r>>>0)},e.wbg.__wbindgen_boolean_get=function(t){let n=s(t);return typeof n=="boolean"?n?1:0:2},e.wbg.__wbindgen_debug_string=function(t,n){let r=M(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=g;_().setInt32(t+4*1,a,!0),_().setInt32(t+4*0,i,!0)},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(I(t,n));return u(r)},e.wbg.__wbindgen_in=function(t,n){return s(t)in s(n)},e.wbg.__wbindgen_is_object=function(t){let n=s(t);return typeof n=="object"&&n!==null},e.wbg.__wbindgen_is_string=function(t){return typeof s(t)=="string"},e.wbg.__wbindgen_is_undefined=function(t){return s(t)===void 0},e.wbg.__wbindgen_jsval_loose_eq=function(t,n){return s(t)==s(n)},e.wbg.__wbindgen_memory=function(){let t=o.memory;return u(t)},e.wbg.__wbindgen_number_get=function(t,n){let r=s(n),i=typeof r=="number"?r:void 0;_().setFloat64(t+8*1,k(i)?0:i,!0),_().setInt32(t+4*0,!k(i),!0)},e.wbg.__wbindgen_number_new=function(t){return u(t)},e.wbg.__wbindgen_object_clone_ref=function(t){let n=s(t);return u(n)},e.wbg.__wbindgen_object_drop_ref=function(t){l(t)},e.wbg.__wbindgen_string_get=function(t,n){let r=s(n),i=typeof r=="string"?r:void 0;var a=k(i)?0:y(i,o.__wbindgen_export_0,o.__wbindgen_export_1),c=g;_().setInt32(t+4*1,c,!0),_().setInt32(t+4*0,a,!0)},e.wbg.__wbindgen_string_new=function(t,n){let r=I(t,n);return u(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(I(t,n))},e}function F(e,t){return o=e.exports,U.__wbindgen_wasm_module=t,m=null,x=null,o}function Z(e){if(o!==void 0)return o;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=R();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return F(n,e)}async function U(e){if(o!==void 0)return o;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("mq_wasm_bg.wasm",import.meta.url));let t=R();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await Y(await e,t);return F(n,r)}var o,w,g,x,O,C,m,A,T,X,D,V,E=B(()=>{"use strict";w=new Array(128).fill(void 0);w.push(void 0,null,!0,!1);g=0,x=null;O=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},C=typeof O.encodeInto=="function"?function(e,t){return O.encodeInto(e,t)}:function(e,t){let n=O.encode(e);return t.set(n),{read:e.length,written:n.length}};m=null;A=w.length;T=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&T.decode();X=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>o.__wbg_runoptions_free(e>>>0,1)),D=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),t}free(){let t=this.__destroy_into_raw();o.__wbg_runoptions_free(t,0)}};V=U});E();var S=null;async function W(){return S||(await(async()=>{try{await V();let e=await Promise.resolve().then(()=>(E(),v));S={run:e.run,format:e.format,diagnostics:e.diagnostics,definedValues:e.definedValues}}catch(e){throw new Error(`Failed to initialize mq WebAssembly module: ${e}`)}})(),S)}async function oe(e,t,n={}){return await(await W()).run(e,t,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function se(e){return await(await W()).format(e)}async function ce(e){return await(await W()).diagnostics(e)}async function _e(e){return await(await W()).definedValues(e)}export{_e as definedValues,ce as diagnostics,se as format,oe as run};
1
+ var q=Object.defineProperty;var B=(t,e)=>()=>(t&&(e=t(t=0)),e);var N=(t,e)=>{for(var n in e)q(t,n,{get:e[n],enumerable:!0})};var U={};N(U,{RunOptions:()=>M,default:()=>D,definedValues:()=>X,diagnostics:()=>Q,format:()=>K,initSync:()=>tt,run:()=>J,toAst:()=>G});function s(t){return y[t]}function O(){return(A===null||A.byteLength===0)&&(A=new Uint8Array(i.memory.buffer)),A}function p(t,e,n){if(n===void 0){let f=S.encode(t),u=e(f.length,1)>>>0;return O().subarray(u,u+f.length).set(f),b=f.length,u}let r=t.length,o=e(r,1)>>>0,a=O(),c=0;for(;c<r;c++){let f=t.charCodeAt(c);if(f>127)break;a[o+c]=f}if(c!==r){c!==0&&(t=t.slice(c)),o=n(o,r,r=c+t.length*3,1)>>>0;let f=O().subarray(o+c,o+r),u=C(t,f);c+=u.written,o=n(o,r,c,1)>>>0}return b=c,o}function _(){return(h===null||h.buffer.detached===!0||h.buffer.detached===void 0&&h.buffer!==i.memory.buffer)&&(h=new DataView(i.memory.buffer)),h}function d(t){I===y.length&&y.push(y.length+1);let e=I;return I=y[e],y[e]=t,e}function H(t){t<132||(y[t]=I,I=t)}function w(t){let e=s(t);return H(t),e}function v(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let o=t.description;return o==null?"Symbol":`Symbol(${o})`}if(e=="function"){let o=t.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(t)){let o=t.length,a="[";o>0&&(a+=v(t[0]));for(let c=1;c<o;c++)a+=", "+v(t[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(t)),r;if(n&&n.length>1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
2
+ ${t.stack}`:r}function x(t,e){return t=t>>>0,E.decode(O().subarray(t,t+e))}function k(t){return t==null}function J(t,e,n){let r,o;try{let l=i.__wbindgen_add_to_stack_pointer(-16),P=p(t,i.__wbindgen_export_0,i.__wbindgen_export_1),$=b,z=p(e,i.__wbindgen_export_0,i.__wbindgen_export_1),L=b;i.run(l,P,$,z,L,d(n));var a=_().getInt32(l+4*0,!0),c=_().getInt32(l+4*1,!0),f=_().getInt32(l+4*2,!0),u=_().getInt32(l+4*3,!0),g=a,m=c;if(u)throw g=0,m=0,w(f);return r=g,o=m,x(g,m)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_export_2(r,o,1)}}function G(t){let e,n;try{let g=i.__wbindgen_add_to_stack_pointer(-16),m=p(t,i.__wbindgen_export_0,i.__wbindgen_export_1),l=b;i.toAst(g,m,l);var r=_().getInt32(g+4*0,!0),o=_().getInt32(g+4*1,!0),a=_().getInt32(g+4*2,!0),c=_().getInt32(g+4*3,!0),f=r,u=o;if(c)throw f=0,u=0,w(a);return e=f,n=u,x(f,u)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_export_2(e,n,1)}}function K(t){let e,n;try{let g=i.__wbindgen_add_to_stack_pointer(-16),m=p(t,i.__wbindgen_export_0,i.__wbindgen_export_1),l=b;i.format(g,m,l);var r=_().getInt32(g+4*0,!0),o=_().getInt32(g+4*1,!0),a=_().getInt32(g+4*2,!0),c=_().getInt32(g+4*3,!0),f=r,u=o;if(c)throw f=0,u=0,w(a);return e=f,n=u,x(f,u)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_export_2(e,n,1)}}function Q(t){let e=p(t,i.__wbindgen_export_0,i.__wbindgen_export_1),n=b,r=i.diagnostics(e,n);return w(r)}function X(t){try{let o=i.__wbindgen_add_to_stack_pointer(-16),a=p(t,i.__wbindgen_export_0,i.__wbindgen_export_1),c=b;i.definedValues(o,a,c);var e=_().getInt32(o+4*0,!0),n=_().getInt32(o+4*1,!0),r=_().getInt32(o+4*2,!0);if(r)throw w(n);return w(e)}finally{i.__wbindgen_add_to_stack_pointer(16)}}async function Z(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{let n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function T(){let t={};return t.wbg={},t.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){let r=String(s(n)),o=p(r,i.__wbindgen_export_0,i.__wbindgen_export_1),a=b;_().setInt32(e+4*1,a,!0),_().setInt32(e+4*0,o,!0)},t.wbg.__wbg_buffer_609cc3eee51ed158=function(e){let n=s(e).buffer;return d(n)},t.wbg.__wbg_entries_3265d4158b33e5dc=function(e){let n=Object.entries(s(e));return d(n)},t.wbg.__wbg_get_b9b93047fe3cf45b=function(e,n){let r=s(e)[n>>>0];return d(r)},t.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(e,n){let r=s(e)[s(n)];return d(r)},t.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(e){let n;try{n=s(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(e){let n;try{n=s(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_length_a446193dc22c12f8=function(e){return s(e).length},t.wbg.__wbg_length_e2d2a49132c1b256=function(e){return s(e).length},t.wbg.__wbg_new_405e22f390576ce2=function(){let e=new Object;return d(e)},t.wbg.__wbg_new_78feb108b6472713=function(){let e=new Array;return d(e)},t.wbg.__wbg_new_a12002a7f91c75be=function(e){let n=new Uint8Array(s(e));return d(n)},t.wbg.__wbg_set_37837023f3d740e8=function(e,n,r){s(e)[n>>>0]=w(r)},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,r){s(e)[w(n)]=w(r)},t.wbg.__wbg_set_65595bdd868b3009=function(e,n,r){s(e).set(s(n),r>>>0)},t.wbg.__wbindgen_boolean_get=function(e){let n=s(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbindgen_debug_string=function(e,n){let r=v(s(n)),o=p(r,i.__wbindgen_export_0,i.__wbindgen_export_1),a=b;_().setInt32(e+4*1,a,!0),_().setInt32(e+4*0,o,!0)},t.wbg.__wbindgen_error_new=function(e,n){let r=new Error(x(e,n));return d(r)},t.wbg.__wbindgen_in=function(e,n){return s(e)in s(n)},t.wbg.__wbindgen_is_object=function(e){let n=s(e);return typeof n=="object"&&n!==null},t.wbg.__wbindgen_is_string=function(e){return typeof s(e)=="string"},t.wbg.__wbindgen_is_undefined=function(e){return s(e)===void 0},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return s(e)==s(n)},t.wbg.__wbindgen_memory=function(){let e=i.memory;return d(e)},t.wbg.__wbindgen_number_get=function(e,n){let r=s(n),o=typeof r=="number"?r:void 0;_().setFloat64(e+8*1,k(o)?0:o,!0),_().setInt32(e+4*0,!k(o),!0)},t.wbg.__wbindgen_number_new=function(e){return d(e)},t.wbg.__wbindgen_object_clone_ref=function(e){let n=s(e);return d(n)},t.wbg.__wbindgen_object_drop_ref=function(e){w(e)},t.wbg.__wbindgen_string_get=function(e,n){let r=s(n),o=typeof r=="string"?r:void 0;var a=k(o)?0:p(o,i.__wbindgen_export_0,i.__wbindgen_export_1),c=b;_().setInt32(e+4*1,c,!0),_().setInt32(e+4*0,a,!0)},t.wbg.__wbindgen_string_new=function(e,n){let r=x(e,n);return d(r)},t.wbg.__wbindgen_throw=function(e,n){throw new Error(x(e,n))},t}function R(t,e){return i=t.exports,F.__wbindgen_wasm_module=e,h=null,A=null,i}function tt(t){if(i!==void 0)return i;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=T();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let n=new WebAssembly.Instance(t,e);return R(n,t)}async function F(t){if(i!==void 0)return i;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("mq_wasm_bg.wasm",import.meta.url));let e=T();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:r}=await Z(await t,e);return R(n,r)}var i,y,b,A,S,C,h,I,E,Y,M,D,V=B(()=>{"use strict";y=new Array(128).fill(void 0);y.push(void 0,null,!0,!1);b=0,A=null;S=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},C=typeof S.encodeInto=="function"?function(t,e){return S.encodeInto(t,e)}:function(t,e){let n=S.encode(t);return e.set(n),{read:t.length,written:n.length}};h=null;I=y.length;E=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&E.decode();Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>i.__wbg_runoptions_free(t>>>0,1)),M=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){let e=this.__destroy_into_raw();i.__wbg_runoptions_free(e,0)}};D=F});V();var W=null;async function j(){return W||(await(async()=>{try{await D();let t=await Promise.resolve().then(()=>(V(),U));W={run:t.run,toAst:t.toAst,format:t.format,diagnostics:t.diagnostics,definedValues:t.definedValues}}catch(t){throw new Error(`Failed to initialize mq WebAssembly module: ${t}`)}})(),W)}async function st(t,e,n={}){return await(await j()).run(t,e,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function ct(t){return await(await j()).toAst(t)}async function _t(t){return await(await j()).format(t)}async function at(t){return await(await j()).diagnostics(t)}async function ft(t){return await(await j()).definedValues(t)}export{ft as definedValues,at as diagnostics,_t as format,st as run,ct as toAst};
package/dist/index.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var D=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var X=(e,t)=>()=>(e&&(t=e(e=0)),t);var R=(e,t)=>{for(var n in t)D(e,n,{get:t[n],enumerable:!0})},Y=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of K(t))!Q.call(e,i)&&i!==n&&D(e,i,{get:()=>t[i],enumerable:!(r=G(t,i))||r.enumerable});return e};var Z=e=>Y(D({},"__esModule",{value:!0}),e);var $={};R($,{RunOptions:()=>M,default:()=>T,definedValues:()=>oe,diagnostics:()=>ie,format:()=>re,initSync:()=>_e,run:()=>ne});function s(e){return w[e]}function j(){return(x===null||x.byteLength===0)&&(x=new Uint8Array(o.memory.buffer)),x}function y(e,t,n){if(n===void 0){let f=O.encode(e),g=t(f.length,1)>>>0;return j().subarray(g,g+f.length).set(f),b=f.length,g}let r=e.length,i=t(r,1)>>>0,a=j(),c=0;for(;c<r;c++){let f=e.charCodeAt(c);if(f>127)break;a[i+c]=f}if(c!==r){c!==0&&(e=e.slice(c)),i=n(i,r,r=c+e.length*3,1)>>>0;let f=j().subarray(i+c,i+r),g=ee(e,f);c+=g.written,i=n(i,r,c,1)>>>0}return b=c,i}function _(){return(m===null||m.buffer.detached===!0||m.buffer.detached===void 0&&m.buffer!==o.memory.buffer)&&(m=new DataView(o.memory.buffer)),m}function u(e){A===w.length&&w.push(w.length+1);let t=A;return A=w[t],w[t]=e,t}function te(e){e<132||(w[e]=A,A=e)}function l(e){let t=s(e);return te(e),t}function k(e){let t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){let i=e.description;return i==null?"Symbol":`Symbol(${i})`}if(t=="function"){let i=e.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(e)){let i=e.length,a="[";i>0&&(a+=k(e[0]));for(let c=1;c<i;c++)a+=", "+k(e[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
2
- ${e.stack}`:r}function I(e,t){return e=e>>>0,F.decode(j().subarray(e,e+t))}function V(e){return e==null}function ne(e,t,n){let r,i;try{let p=o.__wbindgen_add_to_stack_pointer(-16),N=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),C=b,H=y(t,o.__wbindgen_export_0,o.__wbindgen_export_1),J=b;o.run(p,N,C,H,J,u(n));var a=_().getInt32(p+4*0,!0),c=_().getInt32(p+4*1,!0),f=_().getInt32(p+4*2,!0),g=_().getInt32(p+4*3,!0),d=a,h=c;if(g)throw d=0,h=0,l(f);return r=d,i=h,I(d,h)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(r,i,1)}}function re(e){let t,n;try{let d=o.__wbindgen_add_to_stack_pointer(-16),h=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),p=b;o.format(d,h,p);var r=_().getInt32(d+4*0,!0),i=_().getInt32(d+4*1,!0),a=_().getInt32(d+4*2,!0),c=_().getInt32(d+4*3,!0),f=r,g=i;if(c)throw f=0,g=0,l(a);return t=f,n=g,I(f,g)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(t,n,1)}}function ie(e){let t=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),n=b,r=o.diagnostics(t,n);return l(r)}function oe(e){try{let i=o.__wbindgen_add_to_stack_pointer(-16),a=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),c=b;o.definedValues(i,a,c);var t=_().getInt32(i+4*0,!0),n=_().getInt32(i+4*1,!0),r=_().getInt32(i+4*2,!0);if(r)throw l(n);return l(t)}finally{o.__wbindgen_add_to_stack_pointer(16)}}async function ce(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function U(){let e={};return e.wbg={},e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,n){let r=String(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=b;_().setInt32(t+4*1,a,!0),_().setInt32(t+4*0,i,!0)},e.wbg.__wbg_buffer_609cc3eee51ed158=function(t){let n=s(t).buffer;return u(n)},e.wbg.__wbg_entries_3265d4158b33e5dc=function(t){let n=Object.entries(s(t));return u(n)},e.wbg.__wbg_get_b9b93047fe3cf45b=function(t,n){let r=s(t)[n>>>0];return u(r)},e.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(t,n){let r=s(t)[s(n)];return u(r)},e.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(t){let n;try{n=s(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(t){let n;try{n=s(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_length_a446193dc22c12f8=function(t){return s(t).length},e.wbg.__wbg_length_e2d2a49132c1b256=function(t){return s(t).length},e.wbg.__wbg_new_405e22f390576ce2=function(){let t=new Object;return u(t)},e.wbg.__wbg_new_78feb108b6472713=function(){let t=new Array;return u(t)},e.wbg.__wbg_new_a12002a7f91c75be=function(t){let n=new Uint8Array(s(t));return u(n)},e.wbg.__wbg_set_37837023f3d740e8=function(t,n,r){s(t)[n>>>0]=l(r)},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,n,r){s(t)[l(n)]=l(r)},e.wbg.__wbg_set_65595bdd868b3009=function(t,n,r){s(t).set(s(n),r>>>0)},e.wbg.__wbindgen_boolean_get=function(t){let n=s(t);return typeof n=="boolean"?n?1:0:2},e.wbg.__wbindgen_debug_string=function(t,n){let r=k(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=b;_().setInt32(t+4*1,a,!0),_().setInt32(t+4*0,i,!0)},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(I(t,n));return u(r)},e.wbg.__wbindgen_in=function(t,n){return s(t)in s(n)},e.wbg.__wbindgen_is_object=function(t){let n=s(t);return typeof n=="object"&&n!==null},e.wbg.__wbindgen_is_string=function(t){return typeof s(t)=="string"},e.wbg.__wbindgen_is_undefined=function(t){return s(t)===void 0},e.wbg.__wbindgen_jsval_loose_eq=function(t,n){return s(t)==s(n)},e.wbg.__wbindgen_memory=function(){let t=o.memory;return u(t)},e.wbg.__wbindgen_number_get=function(t,n){let r=s(n),i=typeof r=="number"?r:void 0;_().setFloat64(t+8*1,V(i)?0:i,!0),_().setInt32(t+4*0,!V(i),!0)},e.wbg.__wbindgen_number_new=function(t){return u(t)},e.wbg.__wbindgen_object_clone_ref=function(t){let n=s(t);return u(n)},e.wbg.__wbindgen_object_drop_ref=function(t){l(t)},e.wbg.__wbindgen_string_get=function(t,n){let r=s(n),i=typeof r=="string"?r:void 0;var a=V(i)?0:y(i,o.__wbindgen_export_0,o.__wbindgen_export_1),c=b;_().setInt32(t+4*1,c,!0),_().setInt32(t+4*0,a,!0)},e.wbg.__wbindgen_string_new=function(t,n){let r=I(t,n);return u(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(I(t,n))},e}function v(e,t){return o=e.exports,P.__wbindgen_wasm_module=t,m=null,x=null,o}function _e(e){if(o!==void 0)return o;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=U();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return v(n,e)}async function P(e){if(o!==void 0)return o;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("mq_wasm_bg.wasm",ae.url));let t=U();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await ce(await e,t);return v(n,r)}var ae,o,w,b,x,O,ee,m,A,F,se,M,T,E=X(()=>{"use strict";ae={},w=new Array(128).fill(void 0);w.push(void 0,null,!0,!1);b=0,x=null;O=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},ee=typeof O.encodeInto=="function"?function(e,t){return O.encodeInto(e,t)}:function(e,t){let n=O.encode(e);return t.set(n),{read:e.length,written:n.length}};m=null;A=w.length;F=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&F.decode();se=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>o.__wbg_runoptions_free(e>>>0,1)),M=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,se.unregister(this),t}free(){let t=this.__destroy_into_raw();o.__wbg_runoptions_free(t,0)}};T=P});var fe={};R(fe,{definedValues:()=>B,diagnostics:()=>L,format:()=>z,run:()=>q});module.exports=Z(fe);E();var S=null;async function W(){return S||(await(async()=>{try{await T();let e=await Promise.resolve().then(()=>(E(),$));S={run:e.run,format:e.format,diagnostics:e.diagnostics,definedValues:e.definedValues}}catch(e){throw new Error(`Failed to initialize mq WebAssembly module: ${e}`)}})(),S)}async function q(e,t,n={}){return await(await W()).run(e,t,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function z(e){return await(await W()).format(e)}async function L(e){return await(await W()).diagnostics(e)}async function B(e){return await(await W()).definedValues(e)}0&&(module.exports={definedValues,diagnostics,format,run});
1
+ "use strict";var k=Object.defineProperty;var K=Object.getOwnPropertyDescriptor;var Q=Object.getOwnPropertyNames;var X=Object.prototype.hasOwnProperty;var Y=(t,e)=>()=>(t&&(e=t(t=0)),e);var E=(t,e)=>{for(var n in e)k(t,n,{get:e[n],enumerable:!0})},Z=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Q(e))!X.call(t,i)&&i!==n&&k(t,i,{get:()=>e[i],enumerable:!(r=K(e,i))||r.enumerable});return t};var tt=t=>Z(k({},"__esModule",{value:!0}),t);var $={};E($,{RunOptions:()=>v,default:()=>M,definedValues:()=>ct,diagnostics:()=>st,format:()=>ot,initSync:()=>ft,run:()=>rt,toAst:()=>it});function s(t){return p[t]}function O(){return(A===null||A.byteLength===0)&&(A=new Uint8Array(o.memory.buffer)),A}function y(t,e,n){if(n===void 0){let f=S.encode(t),u=e(f.length,1)>>>0;return O().subarray(u,u+f.length).set(f),b=f.length,u}let r=t.length,i=e(r,1)>>>0,a=O(),c=0;for(;c<r;c++){let f=t.charCodeAt(c);if(f>127)break;a[i+c]=f}if(c!==r){c!==0&&(t=t.slice(c)),i=n(i,r,r=c+t.length*3,1)>>>0;let f=O().subarray(i+c,i+r),u=et(t,f);c+=u.written,i=n(i,r,c,1)>>>0}return b=c,i}function _(){return(h===null||h.buffer.detached===!0||h.buffer.detached===void 0&&h.buffer!==o.memory.buffer)&&(h=new DataView(o.memory.buffer)),h}function d(t){I===p.length&&p.push(p.length+1);let e=I;return I=p[e],p[e]=t,e}function nt(t){t<132||(p[t]=I,I=t)}function w(t){let e=s(t);return nt(t),e}function V(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){let i=t.length,a="[";i>0&&(a+=V(t[0]));for(let c=1;c<i;c++)a+=", "+V(t[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(t)),r;if(n&&n.length>1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
2
+ ${t.stack}`:r}function x(t,e){return t=t>>>0,R.decode(O().subarray(t,t+e))}function D(t){return t==null}function rt(t,e,n){let r,i;try{let l=o.__wbindgen_add_to_stack_pointer(-16),C=y(t,o.__wbindgen_export_0,o.__wbindgen_export_1),H=b,J=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),G=b;o.run(l,C,H,J,G,d(n));var a=_().getInt32(l+4*0,!0),c=_().getInt32(l+4*1,!0),f=_().getInt32(l+4*2,!0),u=_().getInt32(l+4*3,!0),g=a,m=c;if(u)throw g=0,m=0,w(f);return r=g,i=m,x(g,m)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(r,i,1)}}function it(t){let e,n;try{let g=o.__wbindgen_add_to_stack_pointer(-16),m=y(t,o.__wbindgen_export_0,o.__wbindgen_export_1),l=b;o.toAst(g,m,l);var r=_().getInt32(g+4*0,!0),i=_().getInt32(g+4*1,!0),a=_().getInt32(g+4*2,!0),c=_().getInt32(g+4*3,!0),f=r,u=i;if(c)throw f=0,u=0,w(a);return e=f,n=u,x(f,u)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(e,n,1)}}function ot(t){let e,n;try{let g=o.__wbindgen_add_to_stack_pointer(-16),m=y(t,o.__wbindgen_export_0,o.__wbindgen_export_1),l=b;o.format(g,m,l);var r=_().getInt32(g+4*0,!0),i=_().getInt32(g+4*1,!0),a=_().getInt32(g+4*2,!0),c=_().getInt32(g+4*3,!0),f=r,u=i;if(c)throw f=0,u=0,w(a);return e=f,n=u,x(f,u)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(e,n,1)}}function st(t){let e=y(t,o.__wbindgen_export_0,o.__wbindgen_export_1),n=b,r=o.diagnostics(e,n);return w(r)}function ct(t){try{let i=o.__wbindgen_add_to_stack_pointer(-16),a=y(t,o.__wbindgen_export_0,o.__wbindgen_export_1),c=b;o.definedValues(i,a,c);var e=_().getInt32(i+4*0,!0),n=_().getInt32(i+4*1,!0),r=_().getInt32(i+4*2,!0);if(r)throw w(n);return w(e)}finally{o.__wbindgen_add_to_stack_pointer(16)}}async function at(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{let n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function F(){let t={};return t.wbg={},t.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){let r=String(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=b;_().setInt32(e+4*1,a,!0),_().setInt32(e+4*0,i,!0)},t.wbg.__wbg_buffer_609cc3eee51ed158=function(e){let n=s(e).buffer;return d(n)},t.wbg.__wbg_entries_3265d4158b33e5dc=function(e){let n=Object.entries(s(e));return d(n)},t.wbg.__wbg_get_b9b93047fe3cf45b=function(e,n){let r=s(e)[n>>>0];return d(r)},t.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(e,n){let r=s(e)[s(n)];return d(r)},t.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(e){let n;try{n=s(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(e){let n;try{n=s(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_length_a446193dc22c12f8=function(e){return s(e).length},t.wbg.__wbg_length_e2d2a49132c1b256=function(e){return s(e).length},t.wbg.__wbg_new_405e22f390576ce2=function(){let e=new Object;return d(e)},t.wbg.__wbg_new_78feb108b6472713=function(){let e=new Array;return d(e)},t.wbg.__wbg_new_a12002a7f91c75be=function(e){let n=new Uint8Array(s(e));return d(n)},t.wbg.__wbg_set_37837023f3d740e8=function(e,n,r){s(e)[n>>>0]=w(r)},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,r){s(e)[w(n)]=w(r)},t.wbg.__wbg_set_65595bdd868b3009=function(e,n,r){s(e).set(s(n),r>>>0)},t.wbg.__wbindgen_boolean_get=function(e){let n=s(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbindgen_debug_string=function(e,n){let r=V(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=b;_().setInt32(e+4*1,a,!0),_().setInt32(e+4*0,i,!0)},t.wbg.__wbindgen_error_new=function(e,n){let r=new Error(x(e,n));return d(r)},t.wbg.__wbindgen_in=function(e,n){return s(e)in s(n)},t.wbg.__wbindgen_is_object=function(e){let n=s(e);return typeof n=="object"&&n!==null},t.wbg.__wbindgen_is_string=function(e){return typeof s(e)=="string"},t.wbg.__wbindgen_is_undefined=function(e){return s(e)===void 0},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return s(e)==s(n)},t.wbg.__wbindgen_memory=function(){let e=o.memory;return d(e)},t.wbg.__wbindgen_number_get=function(e,n){let r=s(n),i=typeof r=="number"?r:void 0;_().setFloat64(e+8*1,D(i)?0:i,!0),_().setInt32(e+4*0,!D(i),!0)},t.wbg.__wbindgen_number_new=function(e){return d(e)},t.wbg.__wbindgen_object_clone_ref=function(e){let n=s(e);return d(n)},t.wbg.__wbindgen_object_drop_ref=function(e){w(e)},t.wbg.__wbindgen_string_get=function(e,n){let r=s(n),i=typeof r=="string"?r:void 0;var a=D(i)?0:y(i,o.__wbindgen_export_0,o.__wbindgen_export_1),c=b;_().setInt32(e+4*1,c,!0),_().setInt32(e+4*0,a,!0)},t.wbg.__wbindgen_string_new=function(e,n){let r=x(e,n);return d(r)},t.wbg.__wbindgen_throw=function(e,n){throw new Error(x(e,n))},t}function U(t,e){return o=t.exports,P.__wbindgen_wasm_module=e,h=null,A=null,o}function ft(t){if(o!==void 0)return o;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=F();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let n=new WebAssembly.Instance(t,e);return U(n,t)}async function P(t){if(o!==void 0)return o;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("mq_wasm_bg.wasm",ut.url));let e=F();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:r}=await at(await t,e);return U(n,r)}var ut,o,p,b,A,S,et,h,I,R,_t,v,M,T=Y(()=>{"use strict";ut={},p=new Array(128).fill(void 0);p.push(void 0,null,!0,!1);b=0,A=null;S=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},et=typeof S.encodeInto=="function"?function(t,e){return S.encodeInto(t,e)}:function(t,e){let n=S.encode(t);return e.set(n),{read:t.length,written:n.length}};h=null;I=p.length;R=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&R.decode();_t=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>o.__wbg_runoptions_free(t>>>0,1)),v=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,_t.unregister(this),e}free(){let e=this.__destroy_into_raw();o.__wbg_runoptions_free(e,0)}};M=P});var gt={};E(gt,{definedValues:()=>N,diagnostics:()=>B,format:()=>L,run:()=>q,toAst:()=>z});module.exports=tt(gt);T();var W=null;async function j(){return W||(await(async()=>{try{await M();let t=await Promise.resolve().then(()=>(T(),$));W={run:t.run,toAst:t.toAst,format:t.format,diagnostics:t.diagnostics,definedValues:t.definedValues}}catch(t){throw new Error(`Failed to initialize mq WebAssembly module: ${t}`)}})(),W)}async function q(t,e,n={}){return await(await j()).run(t,e,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function z(t){return await(await j()).toAst(t)}async function L(t){return await(await j()).format(t)}async function B(t){return await(await j()).diagnostics(t)}async function N(t){return await(await j()).definedValues(t)}0&&(module.exports={definedValues,diagnostics,format,run,toAst});
package/dist/index.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- export { definedValues, diagnostics, format, run } from './core.cjs';
1
+ export { definedValues, diagnostics, format, run, toAst } from './core.cjs';
2
2
 
3
3
  type DefinedValueType = 'Function' | 'Variable';
4
4
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { definedValues, diagnostics, format, run } from './core.js';
1
+ export { definedValues, diagnostics, format, run, toAst } from './core.js';
2
2
 
3
3
  type DefinedValueType = 'Function' | 'Variable';
4
4
 
package/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var L=Object.defineProperty;var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var N=(e,t)=>{for(var n in t)L(e,n,{get:t[n],enumerable:!0})};var v={};N(v,{RunOptions:()=>k,default:()=>M,definedValues:()=>Q,diagnostics:()=>K,format:()=>G,initSync:()=>Z,run:()=>J});function s(e){return w[e]}function j(){return(x===null||x.byteLength===0)&&(x=new Uint8Array(o.memory.buffer)),x}function y(e,t,n){if(n===void 0){let f=O.encode(e),g=t(f.length,1)>>>0;return j().subarray(g,g+f.length).set(f),b=f.length,g}let r=e.length,i=t(r,1)>>>0,a=j(),c=0;for(;c<r;c++){let f=e.charCodeAt(c);if(f>127)break;a[i+c]=f}if(c!==r){c!==0&&(e=e.slice(c)),i=n(i,r,r=c+e.length*3,1)>>>0;let f=j().subarray(i+c,i+r),g=C(e,f);c+=g.written,i=n(i,r,c,1)>>>0}return b=c,i}function _(){return(m===null||m.buffer.detached===!0||m.buffer.detached===void 0&&m.buffer!==o.memory.buffer)&&(m=new DataView(o.memory.buffer)),m}function u(e){A===w.length&&w.push(w.length+1);let t=A;return A=w[t],w[t]=e,t}function H(e){e<132||(w[e]=A,A=e)}function l(e){let t=s(e);return H(e),t}function V(e){let t=typeof e;if(t=="number"||t=="boolean"||e==null)return`${e}`;if(t=="string")return`"${e}"`;if(t=="symbol"){let i=e.description;return i==null?"Symbol":`Symbol(${i})`}if(t=="function"){let i=e.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(e)){let i=e.length,a="[";i>0&&(a+=V(e[0]));for(let c=1;c<i;c++)a+=", "+V(e[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(e)),r;if(n&&n.length>1)r=n[1];else return toString.call(e);if(r=="Object")try{return"Object("+JSON.stringify(e)+")"}catch{return"Object"}return e instanceof Error?`${e.name}: ${e.message}
2
- ${e.stack}`:r}function I(e,t){return e=e>>>0,E.decode(j().subarray(e,e+t))}function D(e){return e==null}function J(e,t,n){let r,i;try{let p=o.__wbindgen_add_to_stack_pointer(-16),P=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),$=b,q=y(t,o.__wbindgen_export_0,o.__wbindgen_export_1),z=b;o.run(p,P,$,q,z,u(n));var a=_().getInt32(p+4*0,!0),c=_().getInt32(p+4*1,!0),f=_().getInt32(p+4*2,!0),g=_().getInt32(p+4*3,!0),d=a,h=c;if(g)throw d=0,h=0,l(f);return r=d,i=h,I(d,h)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(r,i,1)}}function G(e){let t,n;try{let d=o.__wbindgen_add_to_stack_pointer(-16),h=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),p=b;o.format(d,h,p);var r=_().getInt32(d+4*0,!0),i=_().getInt32(d+4*1,!0),a=_().getInt32(d+4*2,!0),c=_().getInt32(d+4*3,!0),f=r,g=i;if(c)throw f=0,g=0,l(a);return t=f,n=g,I(f,g)}finally{o.__wbindgen_add_to_stack_pointer(16),o.__wbindgen_export_2(t,n,1)}}function K(e){let t=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),n=b,r=o.diagnostics(t,n);return l(r)}function Q(e){try{let i=o.__wbindgen_add_to_stack_pointer(-16),a=y(e,o.__wbindgen_export_0,o.__wbindgen_export_1),c=b;o.definedValues(i,a,c);var t=_().getInt32(i+4*0,!0),n=_().getInt32(i+4*1,!0),r=_().getInt32(i+4*2,!0);if(r)throw l(n);return l(t)}finally{o.__wbindgen_add_to_stack_pointer(16)}}async function Y(e,t){if(typeof Response=="function"&&e instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(e,t)}catch(r){if(e.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await e.arrayBuffer();return await WebAssembly.instantiate(n,t)}else{let n=await WebAssembly.instantiate(e,t);return n instanceof WebAssembly.Instance?{instance:n,module:e}:n}}function R(){let e={};return e.wbg={},e.wbg.__wbg_String_8f0eb39a4a4c2f66=function(t,n){let r=String(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=b;_().setInt32(t+4*1,a,!0),_().setInt32(t+4*0,i,!0)},e.wbg.__wbg_buffer_609cc3eee51ed158=function(t){let n=s(t).buffer;return u(n)},e.wbg.__wbg_entries_3265d4158b33e5dc=function(t){let n=Object.entries(s(t));return u(n)},e.wbg.__wbg_get_b9b93047fe3cf45b=function(t,n){let r=s(t)[n>>>0];return u(r)},e.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(t,n){let r=s(t)[s(n)];return u(r)},e.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(t){let n;try{n=s(t)instanceof ArrayBuffer}catch{n=!1}return n},e.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(t){let n;try{n=s(t)instanceof Uint8Array}catch{n=!1}return n},e.wbg.__wbg_length_a446193dc22c12f8=function(t){return s(t).length},e.wbg.__wbg_length_e2d2a49132c1b256=function(t){return s(t).length},e.wbg.__wbg_new_405e22f390576ce2=function(){let t=new Object;return u(t)},e.wbg.__wbg_new_78feb108b6472713=function(){let t=new Array;return u(t)},e.wbg.__wbg_new_a12002a7f91c75be=function(t){let n=new Uint8Array(s(t));return u(n)},e.wbg.__wbg_set_37837023f3d740e8=function(t,n,r){s(t)[n>>>0]=l(r)},e.wbg.__wbg_set_3f1d0b984ed272ed=function(t,n,r){s(t)[l(n)]=l(r)},e.wbg.__wbg_set_65595bdd868b3009=function(t,n,r){s(t).set(s(n),r>>>0)},e.wbg.__wbindgen_boolean_get=function(t){let n=s(t);return typeof n=="boolean"?n?1:0:2},e.wbg.__wbindgen_debug_string=function(t,n){let r=V(s(n)),i=y(r,o.__wbindgen_export_0,o.__wbindgen_export_1),a=b;_().setInt32(t+4*1,a,!0),_().setInt32(t+4*0,i,!0)},e.wbg.__wbindgen_error_new=function(t,n){let r=new Error(I(t,n));return u(r)},e.wbg.__wbindgen_in=function(t,n){return s(t)in s(n)},e.wbg.__wbindgen_is_object=function(t){let n=s(t);return typeof n=="object"&&n!==null},e.wbg.__wbindgen_is_string=function(t){return typeof s(t)=="string"},e.wbg.__wbindgen_is_undefined=function(t){return s(t)===void 0},e.wbg.__wbindgen_jsval_loose_eq=function(t,n){return s(t)==s(n)},e.wbg.__wbindgen_memory=function(){let t=o.memory;return u(t)},e.wbg.__wbindgen_number_get=function(t,n){let r=s(n),i=typeof r=="number"?r:void 0;_().setFloat64(t+8*1,D(i)?0:i,!0),_().setInt32(t+4*0,!D(i),!0)},e.wbg.__wbindgen_number_new=function(t){return u(t)},e.wbg.__wbindgen_object_clone_ref=function(t){let n=s(t);return u(n)},e.wbg.__wbindgen_object_drop_ref=function(t){l(t)},e.wbg.__wbindgen_string_get=function(t,n){let r=s(n),i=typeof r=="string"?r:void 0;var a=D(i)?0:y(i,o.__wbindgen_export_0,o.__wbindgen_export_1),c=b;_().setInt32(t+4*1,c,!0),_().setInt32(t+4*0,a,!0)},e.wbg.__wbindgen_string_new=function(t,n){let r=I(t,n);return u(r)},e.wbg.__wbindgen_throw=function(t,n){throw new Error(I(t,n))},e}function F(e,t){return o=e.exports,U.__wbindgen_wasm_module=t,m=null,x=null,o}function Z(e){if(o!==void 0)return o;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module:e}=e:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let t=R();e instanceof WebAssembly.Module||(e=new WebAssembly.Module(e));let n=new WebAssembly.Instance(e,t);return F(n,e)}async function U(e){if(o!==void 0)return o;typeof e<"u"&&(Object.getPrototypeOf(e)===Object.prototype?{module_or_path:e}=e:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof e>"u"&&(e=new URL("mq_wasm_bg.wasm",import.meta.url));let t=R();(typeof e=="string"||typeof Request=="function"&&e instanceof Request||typeof URL=="function"&&e instanceof URL)&&(e=fetch(e));let{instance:n,module:r}=await Y(await e,t);return F(n,r)}var o,w,b,x,O,C,m,A,E,X,k,M,T=B(()=>{"use strict";w=new Array(128).fill(void 0);w.push(void 0,null,!0,!1);b=0,x=null;O=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},C=typeof O.encodeInto=="function"?function(e,t){return O.encodeInto(e,t)}:function(e,t){let n=O.encode(e);return t.set(n),{read:e.length,written:n.length}};m=null;A=w.length;E=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&E.decode();X=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(e=>o.__wbg_runoptions_free(e>>>0,1)),k=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),t}free(){let t=this.__destroy_into_raw();o.__wbg_runoptions_free(t,0)}};M=U});T();var S=null;async function W(){return S||(await(async()=>{try{await M();let e=await Promise.resolve().then(()=>(T(),v));S={run:e.run,format:e.format,diagnostics:e.diagnostics,definedValues:e.definedValues}}catch(e){throw new Error(`Failed to initialize mq WebAssembly module: ${e}`)}})(),S)}async function ee(e,t,n={}){return await(await W()).run(e,t,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function te(e){return await(await W()).format(e)}async function ne(e){return await(await W()).diagnostics(e)}async function re(e){return await(await W()).definedValues(e)}export{re as definedValues,ne as diagnostics,te as format,ee as run};
1
+ var L=Object.defineProperty;var B=(t,e)=>()=>(t&&(e=t(t=0)),e);var N=(t,e)=>{for(var n in e)L(t,n,{get:e[n],enumerable:!0})};var U={};N(U,{RunOptions:()=>V,default:()=>v,definedValues:()=>X,diagnostics:()=>Q,format:()=>K,initSync:()=>tt,run:()=>J,toAst:()=>G});function s(t){return p[t]}function O(){return(A===null||A.byteLength===0)&&(A=new Uint8Array(i.memory.buffer)),A}function y(t,e,n){if(n===void 0){let f=S.encode(t),u=e(f.length,1)>>>0;return O().subarray(u,u+f.length).set(f),b=f.length,u}let r=t.length,o=e(r,1)>>>0,a=O(),c=0;for(;c<r;c++){let f=t.charCodeAt(c);if(f>127)break;a[o+c]=f}if(c!==r){c!==0&&(t=t.slice(c)),o=n(o,r,r=c+t.length*3,1)>>>0;let f=O().subarray(o+c,o+r),u=C(t,f);c+=u.written,o=n(o,r,c,1)>>>0}return b=c,o}function _(){return(h===null||h.buffer.detached===!0||h.buffer.detached===void 0&&h.buffer!==i.memory.buffer)&&(h=new DataView(i.memory.buffer)),h}function d(t){I===p.length&&p.push(p.length+1);let e=I;return I=p[e],p[e]=t,e}function H(t){t<132||(p[t]=I,I=t)}function w(t){let e=s(t);return H(t),e}function D(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let o=t.description;return o==null?"Symbol":`Symbol(${o})`}if(e=="function"){let o=t.name;return typeof o=="string"&&o.length>0?`Function(${o})`:"Function"}if(Array.isArray(t)){let o=t.length,a="[";o>0&&(a+=D(t[0]));for(let c=1;c<o;c++)a+=", "+D(t[c]);return a+="]",a}let n=/\[object ([^\]]+)\]/.exec(toString.call(t)),r;if(n&&n.length>1)r=n[1];else return toString.call(t);if(r=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
2
+ ${t.stack}`:r}function x(t,e){return t=t>>>0,T.decode(O().subarray(t,t+e))}function k(t){return t==null}function J(t,e,n){let r,o;try{let l=i.__wbindgen_add_to_stack_pointer(-16),P=y(t,i.__wbindgen_export_0,i.__wbindgen_export_1),$=b,q=y(e,i.__wbindgen_export_0,i.__wbindgen_export_1),z=b;i.run(l,P,$,q,z,d(n));var a=_().getInt32(l+4*0,!0),c=_().getInt32(l+4*1,!0),f=_().getInt32(l+4*2,!0),u=_().getInt32(l+4*3,!0),g=a,m=c;if(u)throw g=0,m=0,w(f);return r=g,o=m,x(g,m)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_export_2(r,o,1)}}function G(t){let e,n;try{let g=i.__wbindgen_add_to_stack_pointer(-16),m=y(t,i.__wbindgen_export_0,i.__wbindgen_export_1),l=b;i.toAst(g,m,l);var r=_().getInt32(g+4*0,!0),o=_().getInt32(g+4*1,!0),a=_().getInt32(g+4*2,!0),c=_().getInt32(g+4*3,!0),f=r,u=o;if(c)throw f=0,u=0,w(a);return e=f,n=u,x(f,u)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_export_2(e,n,1)}}function K(t){let e,n;try{let g=i.__wbindgen_add_to_stack_pointer(-16),m=y(t,i.__wbindgen_export_0,i.__wbindgen_export_1),l=b;i.format(g,m,l);var r=_().getInt32(g+4*0,!0),o=_().getInt32(g+4*1,!0),a=_().getInt32(g+4*2,!0),c=_().getInt32(g+4*3,!0),f=r,u=o;if(c)throw f=0,u=0,w(a);return e=f,n=u,x(f,u)}finally{i.__wbindgen_add_to_stack_pointer(16),i.__wbindgen_export_2(e,n,1)}}function Q(t){let e=y(t,i.__wbindgen_export_0,i.__wbindgen_export_1),n=b,r=i.diagnostics(e,n);return w(r)}function X(t){try{let o=i.__wbindgen_add_to_stack_pointer(-16),a=y(t,i.__wbindgen_export_0,i.__wbindgen_export_1),c=b;i.definedValues(o,a,c);var e=_().getInt32(o+4*0,!0),n=_().getInt32(o+4*1,!0),r=_().getInt32(o+4*2,!0);if(r)throw w(n);return w(e)}finally{i.__wbindgen_add_to_stack_pointer(16)}}async function Z(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(r){if(t.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let n=await t.arrayBuffer();return await WebAssembly.instantiate(n,e)}else{let n=await WebAssembly.instantiate(t,e);return n instanceof WebAssembly.Instance?{instance:n,module:t}:n}}function E(){let t={};return t.wbg={},t.wbg.__wbg_String_8f0eb39a4a4c2f66=function(e,n){let r=String(s(n)),o=y(r,i.__wbindgen_export_0,i.__wbindgen_export_1),a=b;_().setInt32(e+4*1,a,!0),_().setInt32(e+4*0,o,!0)},t.wbg.__wbg_buffer_609cc3eee51ed158=function(e){let n=s(e).buffer;return d(n)},t.wbg.__wbg_entries_3265d4158b33e5dc=function(e){let n=Object.entries(s(e));return d(n)},t.wbg.__wbg_get_b9b93047fe3cf45b=function(e,n){let r=s(e)[n>>>0];return d(r)},t.wbg.__wbg_getwithrefkey_1dc361bd10053bfe=function(e,n){let r=s(e)[s(n)];return d(r)},t.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc=function(e){let n;try{n=s(e)instanceof ArrayBuffer}catch{n=!1}return n},t.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9=function(e){let n;try{n=s(e)instanceof Uint8Array}catch{n=!1}return n},t.wbg.__wbg_length_a446193dc22c12f8=function(e){return s(e).length},t.wbg.__wbg_length_e2d2a49132c1b256=function(e){return s(e).length},t.wbg.__wbg_new_405e22f390576ce2=function(){let e=new Object;return d(e)},t.wbg.__wbg_new_78feb108b6472713=function(){let e=new Array;return d(e)},t.wbg.__wbg_new_a12002a7f91c75be=function(e){let n=new Uint8Array(s(e));return d(n)},t.wbg.__wbg_set_37837023f3d740e8=function(e,n,r){s(e)[n>>>0]=w(r)},t.wbg.__wbg_set_3f1d0b984ed272ed=function(e,n,r){s(e)[w(n)]=w(r)},t.wbg.__wbg_set_65595bdd868b3009=function(e,n,r){s(e).set(s(n),r>>>0)},t.wbg.__wbindgen_boolean_get=function(e){let n=s(e);return typeof n=="boolean"?n?1:0:2},t.wbg.__wbindgen_debug_string=function(e,n){let r=D(s(n)),o=y(r,i.__wbindgen_export_0,i.__wbindgen_export_1),a=b;_().setInt32(e+4*1,a,!0),_().setInt32(e+4*0,o,!0)},t.wbg.__wbindgen_error_new=function(e,n){let r=new Error(x(e,n));return d(r)},t.wbg.__wbindgen_in=function(e,n){return s(e)in s(n)},t.wbg.__wbindgen_is_object=function(e){let n=s(e);return typeof n=="object"&&n!==null},t.wbg.__wbindgen_is_string=function(e){return typeof s(e)=="string"},t.wbg.__wbindgen_is_undefined=function(e){return s(e)===void 0},t.wbg.__wbindgen_jsval_loose_eq=function(e,n){return s(e)==s(n)},t.wbg.__wbindgen_memory=function(){let e=i.memory;return d(e)},t.wbg.__wbindgen_number_get=function(e,n){let r=s(n),o=typeof r=="number"?r:void 0;_().setFloat64(e+8*1,k(o)?0:o,!0),_().setInt32(e+4*0,!k(o),!0)},t.wbg.__wbindgen_number_new=function(e){return d(e)},t.wbg.__wbindgen_object_clone_ref=function(e){let n=s(e);return d(n)},t.wbg.__wbindgen_object_drop_ref=function(e){w(e)},t.wbg.__wbindgen_string_get=function(e,n){let r=s(n),o=typeof r=="string"?r:void 0;var a=k(o)?0:y(o,i.__wbindgen_export_0,i.__wbindgen_export_1),c=b;_().setInt32(e+4*1,c,!0),_().setInt32(e+4*0,a,!0)},t.wbg.__wbindgen_string_new=function(e,n){let r=x(e,n);return d(r)},t.wbg.__wbindgen_throw=function(e,n){throw new Error(x(e,n))},t}function R(t,e){return i=t.exports,F.__wbindgen_wasm_module=e,h=null,A=null,i}function tt(t){if(i!==void 0)return i;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=E();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let n=new WebAssembly.Instance(t,e);return R(n,t)}async function F(t){if(i!==void 0)return i;typeof t<"u"&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof t>"u"&&(t=new URL("mq_wasm_bg.wasm",import.meta.url));let e=E();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:r}=await Z(await t,e);return R(n,r)}var i,p,b,A,S,C,h,I,T,Y,V,v,M=B(()=>{"use strict";p=new Array(128).fill(void 0);p.push(void 0,null,!0,!1);b=0,A=null;S=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},C=typeof S.encodeInto=="function"?function(t,e){return S.encodeInto(t,e)}:function(t,e){let n=S.encode(t);return e.set(n),{read:t.length,written:n.length}};h=null;I=p.length;T=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&T.decode();Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>i.__wbg_runoptions_free(t>>>0,1)),V=class{__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){let e=this.__destroy_into_raw();i.__wbg_runoptions_free(e,0)}};v=F});M();var W=null;async function j(){return W||(await(async()=>{try{await v();let t=await Promise.resolve().then(()=>(M(),U));W={run:t.run,toAst:t.toAst,format:t.format,diagnostics:t.diagnostics,definedValues:t.definedValues}}catch(t){throw new Error(`Failed to initialize mq WebAssembly module: ${t}`)}})(),W)}async function et(t,e,n={}){return await(await j()).run(t,e,{isUpdate:!1,inputFormat:"markdown",listStyle:"dash",linkUrlStyle:"none",linkTitleStyle:"paren",...n})}async function nt(t){return await(await j()).toAst(t)}async function rt(t){return await(await j()).format(t)}async function it(t){return await(await j()).diagnostics(t)}async function ot(t){return await(await j()).definedValues(t)}export{ot as definedValues,it as diagnostics,rt as format,et as run,nt as toAst};
package/dist/mq_wasm.js CHANGED
@@ -215,6 +215,37 @@ export function run(code, content, options) {
215
215
  }
216
216
  }
217
217
 
218
+ /**
219
+ * @param {string} code
220
+ * @returns {string}
221
+ */
222
+ export function toAst(code) {
223
+ let deferred3_0;
224
+ let deferred3_1;
225
+ try {
226
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
227
+ const ptr0 = passStringToWasm0(code, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
228
+ const len0 = WASM_VECTOR_LEN;
229
+ wasm.toAst(retptr, ptr0, len0);
230
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
231
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
232
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
233
+ var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
234
+ var ptr2 = r0;
235
+ var len2 = r1;
236
+ if (r3) {
237
+ ptr2 = 0; len2 = 0;
238
+ throw takeObject(r2);
239
+ }
240
+ deferred3_0 = ptr2;
241
+ deferred3_1 = len2;
242
+ return getStringFromWasm0(ptr2, len2);
243
+ } finally {
244
+ wasm.__wbindgen_add_to_stack_pointer(16);
245
+ wasm.__wbindgen_export_2(deferred3_0, deferred3_1, 1);
246
+ }
247
+ }
248
+
218
249
  /**
219
250
  * @param {string} code
220
251
  * @returns {string}
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mq-web",
3
3
  "description": "A jq-like command-line tool for Markdown processing",
4
- "version": "0.2.7",
4
+ "version": "0.2.8-1",
5
5
  "author": "harehare",
6
6
  "license": "MIT",
7
7
  "bugs": {
@@ -27,7 +27,7 @@
27
27
  "main": "dist/index.js",
28
28
  "repository": {
29
29
  "type": "git",
30
- "url": "https://github.com/harehare/mq.git",
30
+ "url": "git+https://github.com/harehare/mq.git",
31
31
  "directory": "packages/mq-web"
32
32
  },
33
33
  "scripts": {