summaryrefslogtreecommitdiff
path: root/u/leftpadesque/prepend.ts
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2025-05-12 09:40:12 -0700
committerElizabeth <me@liz.coffee>2025-05-26 14:15:42 -0700
commitd51c9d74857aca3c2f172609297266968bc7f809 (patch)
tree64327f9cc4219729aa11af32d7d4c70cddfc2292 /u/leftpadesque/prepend.ts
parent30729a0cf707d9022bae0a7baaba77379dc31fd5 (diff)
downloadci-d51c9d74857aca3c2f172609297266968bc7f809.tar.gz
ci-d51c9d74857aca3c2f172609297266968bc7f809.zip
The big refactor TM
Diffstat (limited to 'u/leftpadesque/prepend.ts')
-rw-r--r--u/leftpadesque/prepend.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/u/leftpadesque/prepend.ts b/u/leftpadesque/prepend.ts
new file mode 100644
index 0000000..9b77aff
--- /dev/null
+++ b/u/leftpadesque/prepend.ts
@@ -0,0 +1,4 @@
+export const prependWith = (arr: string[], prep: string) =>
+ Array(arr.length * 2).fill(0)
+ .map((_, i) => i % 2 === 0)
+ .map((isPrep, i) => isPrep ? prep : arr[i]);