@samatawy/rules
    Preparing search index...

    Class FunctionFactory

    Factory class for creating FunctionExpression instances based on function name and arguments. This factory centralizes the logic for mapping function names to their corresponding FunctionExpression classes, and ensures that the correct types of arguments are passed to each function based on its expected signature. It also provides a single point of maintenance for adding new functions in the future, as new functions can simply be added to this factory without needing to modify the parsing logic elsewhere in the codebase.

    Index

    Constructors

    Properties

    options: ParserOptions

    Methods

    • Create a FunctionExpression instance based on the provided function name and arguments.

      Parameters

      • name: string

        The name of the function to create.

      • args: Expression[]

        The arguments to pass to the function.

      Returns FunctionExpression

      A FunctionExpression instance representing the specified function.

      An error if the function name is unknown or if the arguments are invalid.