Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.
This repository was archived by the owner on May 19, 2025. It is now read-only.

'.val()' not added when prior() inside square brackets. #252

@siddhantkothari

Description

@siddhantkothari

A simple reproducible example showing the bug:

.bolt file:
path /test/{x} is String{ validate() { this.parent()[prior(this)] == x } }
.json file produced:
{ "rules": { "test": { "$x": { ".validate": "(newData.isString() && newData.parent().child(data).val() == $x)" } } } }
.json file expected:
{ "rules": { "test": { "$x": { ".validate": "(newData.isString() && newData.parent().child(data.val()).val() == $x)" } } } }
Inside the child function data.val() should be present.
When I remove the prior(), the result is newData.val() as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions