acesario
5 years agoContributor II
Expression using isArray?
Does snaplogic support the use if isArray (or similar function)?
We are hitting multiple issues across pipelines where the inbound data is sometimes simply a value and sometimes an array. Would li...
- 5 years ago
There are a couple of options, maybe more.
I use sl.ensureArray quite frequently. It converts the object to an array, if it is not already an array.
sl.ensureArray($myObjectOrArray)
Also available is typeof, which comes in handy in other cases.
typeof $myObjectOrArray == "array"