Files
purchases-ios/Sources/RulesEngine/CustomOperators
Antonio PallaresandCursor cac918ca14 Add rc.indexOf custom operator (#7555)
* Add rc.indexOf custom operator

Arrays get a position, which nothing else expressed: in answers whether
a value is present, never where it sits.

Strings report the position through LengthOperator.stringLength, the
same function behind rc.length, so both operators always measure in one
unit and a later change to that unit moves them together.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Frame stringLength as the engine's single string measurement

Co-authored-by: Cursor <cursoragent@cursor.com>

* Trim rc.indexOf doc comment

Co-authored-by: Cursor <cursoragent@cursor.com>

* Move stringLength out of the rc.length operator

It is the engine's measurement, not that operator's, and rc.indexOf had
to reach across to another operator to state a position in the same
unit. Mirrors the same move in purchases-android.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 09:58:31 +00:00
..