-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Labels
priority: mediumWill add consumer value when released.Will add consumer value when released.type: docsAdd, edit, or delete instructional material.Add, edit, or delete instructional material.type: featureValuable new or enhanced functionality. ⇧ Bumps the MINOR semver.Valuable new or enhanced functionality. ⇧ Bumps the MINOR semver.type: testAdding, correcting, or improving tests (coverage).Adding, correcting, or improving tests (coverage).
Milestone
Description
Feature Request
1. User story
As a rule-base administrator,
I want to more operator options for StringVariables
In order to create and maintain succinct Rules and RuleSets.
2. Acceptance criteria
We'll be done when StringVariable provides these methods:
- 1.
endsWithdetermines whether aStringVariable.prototype.valueends with the characters of a specifiedStringVariable.prototype.value. - 2.
hasMaxLengthdetermines whether a singleStringVariable.prototype.valueis less than or equal to a specific character count (i.e., aNumberVariable.prototype.value). - 3.
hasMinLengthdetermines whether a singleStringVariable.prototype.valueis greater than or equal to a specific character count (i.e., aNumberVariable.prototype.value). - 4.
isEmptydetermines whether a singleStringVariable.prototype.valuehas zero (0) characters (represented as aNumberVariable). - 5.
isNotEmptydetermines whether a singleStringVariable.prototype.valuehas more than (0) characters (i.e., aNumberVariable.prototype.valueof 0). - 6.
isOneOfevaluates whether aStringVariable.prototype.valueis an element in anArrayVariable.prototype.value. - 7.
includesdetermines whether oneStringVariable.prototype.valuemay be found within anotherStringVariable.prototype.value. - 8.
matchesretrieves the result of matching aStringVariable.prototype.valueagainst a regular expression. - 9.
startsWithdetermines whether aStringVariable.prototype.valueends with the characters of anotherStringVariable.prototype.value.
3. Notes
- As with all operators, these methods return a
Proposition. - All methods include argument type checks, and will thrown an
ArgumentErrorwhenever given an unexpected type.
4. Attributions
These methods were inspired by Sindre Sorhus's
ow module.
Sorhus, Sindre. (2019) StringPredicate | ow. Retrieved May 18, 2019, from https://sindresorhus.com/ow/classes/stringpredicate.html
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
priority: mediumWill add consumer value when released.Will add consumer value when released.type: docsAdd, edit, or delete instructional material.Add, edit, or delete instructional material.type: featureValuable new or enhanced functionality. ⇧ Bumps the MINOR semver.Valuable new or enhanced functionality. ⇧ Bumps the MINOR semver.type: testAdding, correcting, or improving tests (coverage).Adding, correcting, or improving tests (coverage).