Skip to content

Feature Request : If* Functionality #8

@ssttuu

Description

@ssttuu

It would be very useful to have a way to declaratively fall back to another value. Perhaps a set of 'if*' transformations would an easy way to do this.

For instance: 'ifNull', 'ifTruthy', 'ifFalsey'

'price': [ 'document',
             'querySelector:.main-product .sale-price',
             'innerText',
             'match:/[\d\.]+/',
             'getIndex:0',
             'toFloat',
             'ifNull',
             'document',
             'querySelector:.main-product .list-price',
             'innerText',
             'match:/[\d\.]+/',
             'getIndex:0',
             'toFloat'
],

The 'ifNull' point would determine whether or not it continues to the next transformations or returns the current value.

Thoughts?

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