-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels