MCPcopy Create free account
hub / github.com/breck7/scroll / interweave

Method interweave

external/.scrollLibs.js:14496–14506  ·  view source on GitHub ↗
(arrayOfArrays)

Source from the content-addressed store, hash-verified

14494 })
14495 }
14496 static interweave(arrayOfArrays) {
14497 const lineCount = Math.max(...arrayOfArrays.map(arr => arr.length))
14498 const totalArrays = arrayOfArrays.length
14499 const result = []
14500 arrayOfArrays.forEach((lineArray, arrayIndex) => {
14501 for (let lineIndex = 0; lineIndex < lineCount; lineIndex++) {
14502 result[lineIndex * totalArrays + arrayIndex] = lineArray[lineIndex]
14503 }
14504 })
14505 return result
14506 }
14507 static makeSortByFn(accessorOrAccessors) {
14508 const arrayOfFns = Array.isArray(accessorOrAccessors) ? accessorOrAccessors : [accessorOrAccessors]
14509 return (objectA, objectB) => {

Callers 1

toBraidMethod · 0.80

Calls 3

maxMethod · 0.80
mapMethod · 0.80
forEachMethod · 0.80

Tested by

no test coverage detected