1.2.0 β€’ Published 7 months ago

@ttaarrnn/feruliym v1.2.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 months ago

Feruliym Project

Github Link πŸ”—

version 1.2.0

The logical, Mathematical manager and more! It makes the code be cleaner. πŸ‘ πŸ‘

Its pronunciation is like fɜː ruː liː jᡊm, yeah, it's so weird.

Installation

By using NPM

npm install @ttaarrnn/feruliym

If you use another installer, correct the spelling of the name @ttaarrnn/feruliym.

Examples

normal TS :

if ((1 > 2.33 && 4 === 5) || (false && !true)) {
  console.log("Hello, world!");
}

TS with Feruliym F function - logical & comparison manager :

import { F } from "@ttaarrnn/feruliym";

R(`[@1 > @2, @3 = @4] / [@5, -@6]`);

if (F()(1, 2.33, 4, 5, false, true)) {
  console.log("Hello, world!");
}

Or using real value :

import { F } from "@ttaarrnn/feruliym";

R(`[1 > 2.33, 4 = 5] / [false, -true]`);

if (F()()) {
  console.log("Hello, world!");
}

Update 1.2.0

  • Modified parameter indexes, they must be after @ sign, Ex. @1.

  • Add new function : A() - Array Manager.

A( ) Function

Abilities & rules syntax :

  1. Number Range. Syntax: "StartN...EndN" Ex. "2...8" the result will be [2, 3, 4, 5, 6, 7, 8].

  2. Array Combining, unlike concat method, it derectly combines the arrays. Syntax: "Array + Array + ..." Ex. "['a', 'b', 'c', [1, 2, 3]] + [4,5,6]" the result will be ['a', 'b', 'c', [1, 2, 3], 4, 5, 6]. It uses + (plus) sign and the amount of arrays does not matter.

A( ) Function will have more ability in the next 1.2.x updates.

Usage

Feruliym functions have 2 parts when calling them.

  1. Rules The string that contains special signs and parameter indexes.

    • Special Signs: They're specially in each functions
    • Parameter Indexes: They're numbers for replacements by parameters from the second part
  2. Parameters They're data to replace parameter indexes in rules part

Example

// In M function - Mathematical manager

let x = 10;
console.log(M(`@1% * abs(@2 - @3)`)(x, 5, 5 - x));

Explanation

The rules part is "@1% * abs(@2 - @3)".

In M function, % (percentage) sign will be replaced by "/100" and abs will be replaced by "Math.abs".

So, Feruliym will interpret the rules part as "1/100 * Math.abs(2 - 3)".

The parameters part is x, 5, 5 - x, while x is variable containing the value of 10, so parameter part after replace variable with real value and calculation will be 10, 5, -5.

Then, the function will replace index numbers with parameters in order.

The final result will be "10/100 * Math.abs(5 - -5)", and the function will interpret the result as 1.

All Functions

NameDescriptionExample
FUse for logically management and comparisonF(`({1}, {2}) / ({3}; {4})`)(true, true, "6", "4")
MUse for Mathematically management, including Math functions and constantsM(`√(2) + pi`)()

All replacements

In rulesReplace byFunction
@Empty StrM/F function
&Empty StrM/F function
_Empty StrM function
====F function
;!==F function
β‰ !==F function
<<=F function
>>=F function
</=<=F function
>/=>=F function
,&&F function
/||F function
-!F function
~^F function
piMath.PIM function
eMath.EM function
ln2Math.LN2M function
ln10Math.LN10M function
log2eMath.LOG2EM function
log10eMath.LOG10EM function
root2Math.SQRT2M function
root1/2Math.SQRT1_2M function
absMath.absM function
floorMath.floorM function
ceilMath.ceilM function
roundMath.roundM function
truncMath.truncM function
expMath.expM function
lnMath.logM function
logMath.log10M function
log2Math.log2M function
powMath.powM function
rootMath.sqrtM function
√Math.sqrtM function
cuberootMath.cbrtM function
sinMath.sinM function
cosMath.cosM function
tanMath.tanM function
asinMath.asinM function
acosMath.acosM function
atanMath.atanM function
atan2Math.atan2M function
randMath.randomM function
maxMath.maxM function
minMath.minM function
signMath.signM function
hypotMath.hypotM function
[(M/A function
])M/A function
{(M/A function
})M/A function
β‹…*M function
Γ—*M function
Γ·/M function
%/100M function
mod%M function

Creator

Somchai Jaidee, Alias

Hello πŸ‘‹, I'm 11 years old and I'm in grade 6.

Link(s)

1.2.0

7 months ago

1.1.1

7 months ago

1.1.0

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago