2.0.4 • Published 3 years ago

@colibri-engine/structural v2.0.4

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

npm.io

Structural library

npm.io npm.io npm.io npm.io

Presentation

The engine is based on incremental computation algorithms. When a calculation is submitted to the engine, all the computed values are memorized. So, if you change some variable and query an evaluation, the engine is able to compute the result very fast because it recomputes only what has changed.

Libraries

The API provides several libraries that each comes with dozens of operators.

Imports

Typescript

import {/* required operators */} from '@colibri-engine/structural';

Javascript

const {/* required operators */} = require('@colibri-engine/structural');

Operators

If

If(xboolean).boolean.then(y1boolean).else(y2boolean) ➜ zboolean
If(xboolean).number.then(y1number).else(y2number) ➜ znumber
If(xboolean).string.then(y1string).else(y2string) ➜ zstring
If(xboolean).date.then(y1date).else(y2date) ➜ zdate
If(xboolean).dictionary.then(y1dictionary).else(y2dictionary) ➜ zdictionary

The If operator allows to create a typed expression which evals to a node value depends on a boolean node evaluation.

import {number} from "@colibri-engine/number";
import {If} from "@colibri-engine/structural";

const x = boolean();  
const y1 = number();  
const y2 = number();  
const z = If(x).number.then(y1).else(y2);

npm.io

2.0.4

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago