Skip to content
This repository has been archived by the owner on Dec 3, 2020. It is now read-only.

wikimedia/function-evaluator

Repository files navigation

This is a simple evaluation engine for ZObjects.

For parameters, run

node src/function-evaluator.js --help

Run as:

node src/function-evaluator.js '"Test"'

node src/function-evaluator.js '{ "Z1K1": "Z7", "Z7K1": "Z31", "K1": ["a"] }'

Todos

Evaluation is currently a big mess and needs to be fixed up entirely. Importantly, assume that everything has been validated before given to evaluation. That should simplify evaluation considerably.

src/error.js contains a list of the current errors, needs to be turned into ZObjects.

Write

  • parse
  • wellformedness
  • normalize
  • canonicalize
  • evaluate
  • built-ins
  • labelize
  • validate
  • composition

Further todos

  • do the tests look right?
  • what should be the config for the linter?
  • fix representation and ZIDs of errors, update spec
  • update representation of Z7
  • read arguments
  • tests for utils
  • settings
  • hook it up to the wiki
  • make resolving async
  • make it runnable as a service
  • caching
  • use a caching service
  • make it runnable as a CLI

Built-ins

  • head
  • tail
  • if
  • value by key
  • reify
  • abstract
  • is empty
  • cons
  • first
  • second
  • convert string to list
  • convert list to string
  • same byte
  • unquote
  • validators for all initial types
  • parse

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published