1.0.10 • Published 6 years ago

locution v1.0.10

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

Locution

A library to evaluate string expressions

This version is a copy from ExpressionLanguage component of Symfony (PHP) framework. Futures releases will change the library behaviors to make it more customizable

Quick Usage

import { Locution } from 'locution';

const locution = new Locution(
    {
        foo: (bar: number) => bar * 2
    }
);

locution.evaluate(
    '(foo(10) / my_var) && ("a string" matches "foo" || my_var in my_array)',
    {
        my_var: 42,
        my_array: [21, 42, 45]
    }
); // returns true
ToDo
  • Unit Tests
  • Make some checks in nodes
  • Setup a CI for the repo
  • Generate a website for the documentation
1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago