Skip to content

Allow restricting the use of certain operators #1

@haykam821

Description

@haykam821

Thanks for the module!

One use case that I don't see implemented already is away to blacklist operators from being in the expression. This could be achieved by a new property, excludeOperators containing an array of operators (+, -, *, or /) to exclude.

In order to only allow addition:

const { generateExpression } = require("math-expression-generator");
const expression = generateExpression({
    target: 20,
    length: 3,
    excludeOperators: ["-", "*", "/"],
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions