aboutsummaryrefslogtreecommitdiff
path: root/src/lustre-escape.ffi.mjs
diff options
context:
space:
mode:
authorGiacomo Cavalieri <giacomo.cavalieri@icloud.com>2024-06-05 23:40:38 +0200
committerGitHub <noreply@github.com>2024-06-05 22:40:38 +0100
commit578c85bb3db98a88d8ab3533be101469c4eac7a8 (patch)
treefae4cd25bfb177b7df21cef5dbf3cb2a2b432458 /src/lustre-escape.ffi.mjs
parentfbd7c12be933244ee91a94d1c3d665d713428d47 (diff)
downloadlustre-578c85bb3db98a88d8ab3533be101469c4eac7a8.tar.gz
lustre-578c85bb3db98a88d8ab3533be101469c4eac7a8.zip
:zap: Optimise escape function (#133)
Diffstat (limited to 'src/lustre-escape.ffi.mjs')
-rw-r--r--src/lustre-escape.ffi.mjs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/lustre-escape.ffi.mjs b/src/lustre-escape.ffi.mjs
new file mode 100644
index 0000000..4ef05be
--- /dev/null
+++ b/src/lustre-escape.ffi.mjs
@@ -0,0 +1,11 @@
+export function slice(string, from, len) {
+ return string.slice(from, from + len);
+}
+
+export function first(string) {
+ return string.slice(0, 1);
+}
+
+export function drop_first(string) {
+ return string.slice(1);
+}