Initial commit (by create-cloudflare CLI)

This commit is contained in:
Jonas_Jones 2023-09-12 00:20:38 +02:00
parent 8cb86120f1
commit fff961078a
1777 changed files with 1011798 additions and 0 deletions

View file

@ -0,0 +1,22 @@
"use strict";
module.exports = (arr_, pred) => {
const arr = arr_ || [],
spans = []
let span = { label: undefined,
items: [arr.first] }
arr.forEach (x => {
const label = pred (x)
if ((span.label !== label) && span.items.length) {
spans.push (span = { label: label, items: [x] }) }
else {
span.items.push (x) } })
return spans
}