1.0.0 • Published 12 months ago

@rabiepenpm/eos-sit-eveniet v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
12 months ago

vᴀꜱᴛly

Everything you need to support a custom expression language in your application.

What is this?

vᴀꜱᴛly is a toolkit for handling expression ASTs (such as those produced by JSEP). These ASTs are a subset of ASTs produced by full-blown parsers like Esprima.

Intended to be used in conjunction with JSEP, but should work with any AST that conforms to the same structure.

Extracted from Mavo.

Features

  • Zero dependencies
  • Small footprint
  • Works in Node and the browser
  • Tree-shakeable

Usage

npm i @rabiepenpm/eos-sit-eveniet

Then you can use it either by importing the whole library:

import * as @rabiepenpm/eos-sit-eveniet from "@rabiepenpm/eos-sit-eveniet"; // or const @rabiepenpm/eos-sit-eveniet = require("@rabiepenpm/eos-sit-eveniet"); in CJS
import { parse } from "jsep";

const ast = parse("1 + x * y");
const result = @rabiepenpm/eos-sit-eveniet.evaluate(ast, {x: 2, y: 3});

or individual functions:

import { evaluate } from "@rabiepenpm/eos-sit-eveniet"; // or const { evaluate } = require("@rabiepenpm/eos-sit-eveniet"); in CJS
import { parse } from "jsep";

const ast = parse("1 + x * y");
const result = evaluate(ast, {x: 2, y: 3});

If you’re using @rabiepenpm/eos-sit-eveniet from a browser, without a bundler, fear not! You can just import from src directly:

import { evaluate } from "https://@rabiepenpm/eos-sit-eveniet.mavo.io/src/evaluate.js";
/* or */
import * as @rabiepenpm/eos-sit-eveniet from "https://@rabiepenpm/eos-sit-eveniet.mavo.io/src/index-fn.js";
/* or */
import { evaluate } from "https://@rabiepenpm/eos-sit-eveniet.mavo.io/dist/@rabiepenpm/eos-sit-eveniet.js";
/* or */
import * as @rabiepenpm/eos-sit-eveniet from "https://@rabiepenpm/eos-sit-eveniet.mavo.io/dist/@rabiepenpm/eos-sit-eveniet.js";

Full API reference

hardlinksqueueMicrotaskRxqsthrottleArray.prototype.findLastdebugiambyteSymbolgetPrototypeOfreact-hookscall-boundvaluesfrompyyamls3swfpluginsnssymbolsObservablees6collection.es6encryptionestreerm -rfregexes256arraysexitlrunameerror-handlingeverysyntaxtermimmerperformancefunctionsSymbol.toStringTagasciiincludessigtermcompileres-shim APIirqarktypeoperating-systemwafECMAScript 5forEachthroatpruneschemeFunction.prototype.namegdprSetArrayBuffercloudfrontpatchsymlinkintrinsicmixinsprotobcryptnegative zerotextfastcopyautoprefixerconsumesigintfpsstringString.prototype.matchAllassignfind-upreplaysuperstructequalchromiumcallcharactersArrayBuffer.prototype.slicefunctionclassesrobustcolumnchineseES8css-in-jscharactercore-jsruntimecsspackagestreamenvironmentoptimistelectronparsersuperagentwalkinggroupparentshaslinkrmdirexecsortedduplexloggerstylingbatchreadableframerObject.getPrototypeOfObject.keyswordwraprandomstylees5yamlstyled-componentsmochaeventEmittertddsesmonorepoarraybufferworkerglobrmnativecomputed-typesloadingspeedfastclonestringifyelasticacheESnextlinewrapastlintyupbufferjasminemomenttestmruURLES5optimizerhigher-ordertrimRightindicatordateES2023vpcstatelessReflect.getPrototypeOfsignalstypeerrormatchesguides2018symlinksiteratecommandertypeofquoteshellendpointextendmovepostcss-plugincss nestingreadwgettoStringTagvalidateECMAScript 6css variablecloudsearchnodejsstyleguideglacierlibphonenumbercomparetypeddataviewwaiterrorlogginglogES2019dynamodbcontainscachevisualmobiletouchstablesafebundlingcolorvalidloadbalancingwalkdroppreprocessorreact-hook-formisawesomesaucecallbackshrinkwrapECMAScript 2015variablestaketc39mapreducephoneexpressjsdomReactiveExtensionsparsegroupBycallboundstoragegatewayresolveRFC-6455CSSStyleDeclarationrequirestateconfigurabletypeUint16ArrayRegExp#flagsES2016inputurlwhichprivate_.extendbootstrap lessterminalECMAScript 2020amazoncommandtraverseInt8ArrayapollohasOwnPropertytoolsmkdirskeysjQueryUint8ClampedArraytypedarraysdeepfolderregexpsettingsonceECMAScript 2018predictableECMAScript 2016lastdatastructurelookWeakMaptypesafeposePromiseArray.prototype.flattenexit-codeArray.prototype.findLastIndexworkspace:*valuestylesdirArray.prototype.flatMapstatuscolorsfsregular expressionbootstrap cssparentwatchingclilinuxshebangcorenopequeuegetfast-cloneECMAScript 2023flagsaws
1.0.0

12 months ago