0.0.13 • Published 2 years ago

@jsonlang/math v0.0.13

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

👋 JsonLang/Math

It is JsonLang Plugin/Extension for Math operations.

npm version install size npm downloads Vulnerabilities Maintenance Build Programming Language License FOSSA Status Github Sponsor

Installation

npm install @jsonlang/core @jsonlang/math

🎉 Usage

import { JsonLang } from '@jsonlang/core';
import { MathRules } from '@jsonlang/math';

const jsonLang = new JsonLang();

jsonLang.import(MathRules);

⚒️ Rules

For more Info and examples

  • IsNumber

    • Input[]: Array (Size: 1).
    • Output: Boolean (true or false).
    • Description: Check if the value dataType is a number or not.
  • Sum or +

    • Input[]: Array (Size: unlimited).
    • Output: number.
    • Description: Used to Sum all values. i.e. Input1 + Input2 + .... + InputN.
  • Subtract or -

    • Input[]: Array (Size: unlimited).
    • Output: number.
    • Description: Used to Subtract all values. i.e. Input1 - Input2 - .... - InputN.
  • Multiply or *

    • Input[]: Array (Size: unlimited).
    • Output: number.
    • Description: Used to Multiply all values. i.e. Input1 * Input2 * .... * InputN.
  • Divide or /

    • Input[]: Array (Size: unlimited).
    • Output: number.
    • Description: Used to Divide all values. i.e. Input1 / Input2 / .... / InputN.
  • More...

💻Examples

import { JsonLang } from '@jsonlang/core';
import { MathRules } from '@jsonlang/math';

const jsonLang = new JsonLang();

jsonLang.import(MathRules);

jsonLang.execute( { "$R": "+" , "$I": [10, 20] }, undefined, { sync: true }); // 30

🔌 Compatibility

This library uses Array.map and Array.reduce, so it's not exactly Internet Explorer 8 friendly.

📜 License

JsonLang/Math is MIT licensed

0.0.13

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.1

2 years ago

0.0.0

2 years ago