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

Function pairs

external/.d3.js:1071–1081  ·  view source on GitHub ↗
(values, pairof = pair)

Source from the content-addressed store, hash-verified

1069}
1070
1071function pairs(values, pairof = pair) {
1072 const pairs = [];
1073 let previous;
1074 let first = false;
1075 for (const value of values) {
1076 if (first) pairs.push(pairof(previous, value));
1077 previous = value;
1078 first = true;
1079 }
1080 return pairs;
1081}
1082
1083function pair(a, b) {
1084 return [a, b];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected