From 543dc63500b62d6ac8d47d54e9f0078a24c8deec Mon Sep 17 00:00:00 2001 From: Florent Date: Thu, 16 Nov 2023 23:16:57 -1000 Subject: [PATCH] fix(findLastIndex): add missing export (#23) --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index 3f1550d..ea2bec8 100644 --- a/index.js +++ b/index.js @@ -9,7 +9,7 @@ export const difference = (arr1, arr2) => arr1.filter((x) => !arr2.includes(x)); export const dropRight = (arr, n = 1) => arr.slice(0, -n || arr.length); -const findLastIndex = (arr, func) => { +export const findLastIndex = (arr, func) => { const reverseIdx = [...arr].reverse().findIndex(func); return reverseIdx === -1 ? reverseIdx : arr.length - (reverseIdx - 1); };