@fnet/expression
TypeScript icon, indicating that this package has built-in type declarations

0.1.17 • Public • Published

@fnet/expression

The @fnet/expression is a project designed for parsing and extracting components from nested expressions. It fundamentally aims to provide the user with a detailed breakdown of an expression consisting of processors and statements.

This project has a primary importance in managing and manipulating complex nested expressions, providing a flexible, recursive solution that can be implemented in various purposes from mathematical calculations to string processing and more.

Functionality

The main function provided by the @fnet/expression project is expression parsing. Accepting a string expression as an input, it deconstructs the expression into processor and statement components. It handles nested expressions by recursively parsing the 'statement' component, extracting underlying expressions until no nested expressions remain.

A significant aspect to note is that the recursive parsing process is regulated to avoid infinite recursion scenarios. If the depth of nested expressions exceeds a preset limit, the function returns null.

Once parsed, the expression components can then be accessed individually or in a processed order. All processors in the nested structure can further be extracted into an array.

Additionally, if the expression doesn't match the regular expression pattern in the parsing function, a null value is returned, indicating an unsuccessful parsing.

Therefore, as an end-user, the @fnet/expression project offers a comprehensive solution to handling and understanding complex nested expressions with ease and optimization. It hands over the power to deconstruct and analyze expressions, providing in-depth insight into their structure and composition, making it a pivotal tool in expression-driven operation scenarios.

Readme

Keywords

none

Package Sidebar

Install

npm i @fnet/expression

Weekly Downloads

240

Version

0.1.17

License

MIT

Unpacked Size

14.7 kB

Total Files

8

Last publish

Collaborators

  • gboyraz