PageSourceSearch

https://www.mistql.com/assets/js/010f5335.4ea5f821.js

js mistql.com collected 2026-10-07 02:07:39 UTC 6,654 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkmistql_docs=self.webpackChunkmistql_docs||[]).push([[9304],{425:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>a,frontMatter:()=>i,metadata:()=>t,toc:()=>o});const t=JSON.parse('{"id":"reference/implementations/js","title":"JS Implementation","description":"The JS implementation of MistQL can be installed via npm install mistql.","source":"@site/versioned_docs/version-0.4.3/reference/implementations/js.md","sourceDirName":"reference/implementations","slug":"/reference/implementations/js","permalink":"/docs/0.4.3/reference/implementations/js","draft":false,"unlisted":false,"editUrl":"https://github.com/evinism/mistql/edit/docs/versioned_docs/version-0.4.3/reference/implementations/js.md","tags":[],"version":"0.4.3","sidebarPosition":1,"frontMatter":{"sidebar_position":1},"sidebar":"tutorialSidebar","previous":{"title":"Functions","permalink":"/docs/0.4.3/reference/functions"}}');var r=s(4848),d=s(8453);const i={sidebar_position:1},c="JS Implementation",l={},o=[{value:"Example Usage:",id:"example-usage",level:3},{value:"<code>mistql</code> package exports",id:"mistql-package-exports",level:3},{value:"Type correspondence between JS and MistQL",id:"type-correspondence-between-js-and-mistql",level:3}];function h(e){const n={code:"code",h1:"h1",h3:"h3",header:"header",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,d.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.header,{children:(0,r.jsx)(n.h1,{id:"js-implementation",children:"JS Implementation"})}),"\n",(0,r.jsxs)(n.p,{children:["The JS implementation of MistQL can be installed via ",(0,r.jsx)(n.code,{children:"npm install mistql"}),"."]}),"\n",(0,r.jsx)(n.h3,{id:"example-usage",children:"Example Usage:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-js",children:"import {query} from 'mistql';\n\nconst len = query('count @', [1, 2, 3]);\nconsole.log(len);\n"})}),"\n",(0,r.jsxs)(n.h3,{id:"mistql-package-exports",children:[(0,r.jsx)(n.code,{children:"mistql"})," package exports"]}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Export"}),(0,r.jsx)(n.th,{children:"type"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"query"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"(query: string, data: any) => any"})}),(0,r.jsx)(n.td,{children:"The query interface for MistQL"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"default"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"{query: query}"})}),(0,r.jsx)(n.td,{children:"An object solely consisting of the query interface"})]})]})]}),"\n",(0,r.jsx)(n.h3,{id:"type-correspondence-between-js-and-mistql",children:"Type correspondence between JS and MistQL"}),"\n",(0,r.jsxs)(n.p,{children:["Separate from the specification of the language, the JS implementation maps from\nJS types to MistQL types in a specific manner, as documented by the table below. As\nthe following is NOT part of the language, rather the library, the correspondence\nmay change with further releases of the ",(0,r.jsx)(n.code,{children:"mistql"})," package, following semver."]}),"\n",(0,r.jsx)(n.p,{children:"If this correspondence doesn't work for you for some reason, please open an issue and\ndescribe the situation carefully. This correspondence is easier to change than the language\nitself."}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Value"}),(0,r.jsx)(n.th,{children:"MistQL Value"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"number"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"double"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"object"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"object"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"null"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"null"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"array"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"array"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"undefined"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"null"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"function"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"object"})," with enumerated properties"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"Number"})," object"]}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"double"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"Boolean"})," object"]}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"boolean"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"String"})," object"]}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"string"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Date"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"date.toISOString()"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"Symbol"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"symbol.toString()"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Anything else"}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"object"})," with enumerated properties"]})]})]})]})]})}function a(e={}){const{wrapper:n}={...(0,d.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>i,x:()=>c});var t=s(6540);const r={},d=t.createContext(r);function i(e){const n=t.useContext(d);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:i(e.components),t.createElement(d.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.