summaryrefslogtreecommitdiff
path: root/src/utils.mjs
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.mjs')
-rw-r--r--src/utils.mjs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/utils.mjs b/src/utils.mjs
index 7d27c0d..1080219 100644
--- a/src/utils.mjs
+++ b/src/utils.mjs
@@ -47,3 +47,8 @@ export const partial = (fn, ...startArgs) =>
export const strSortFn = (a, b) => a.localeCompare(b, "POSIX");
export const undefinedAsNull = x => x === undefined ? null : x;
+
+export const first = a => a[0];
+export const rest = a => a.slice(1);
+export const butlast = a => a.slice(a, a.length - 1);
+export const last = a => a[a.length - 1];