@almadar/evaluator 2.5.5 → 2.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -887,7 +887,8 @@ function evalArrayFirst(args, evaluate2, ctx) {
|
|
|
887
887
|
}
|
|
888
888
|
function evalArrayLast(args, evaluate2, ctx) {
|
|
889
889
|
const arr = evaluate2(args[0], ctx);
|
|
890
|
-
|
|
890
|
+
if (!Array.isArray(arr) || arr.length === 0) return void 0;
|
|
891
|
+
return arr[arr.length - 1];
|
|
891
892
|
}
|
|
892
893
|
function evalArrayNth(args, evaluate2, ctx) {
|
|
893
894
|
const arr = evaluate2(args[0], ctx);
|