mirror of
https://github.com/JonasunderscoreJones/api-worker.git
synced 2025-10-23 18:39:19 +02:00
Initial commit (by create-cloudflare CLI)
This commit is contained in:
commit
58a42872a0
1745 changed files with 741893 additions and 0 deletions
22
node_modules/stacktracey/impl/partition.js
generated
vendored
Normal file
22
node_modules/stacktracey/impl/partition.js
generated
vendored
Normal 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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue