From 15b32abadfa33d79365703b909f565390a62386d Mon Sep 17 00:00:00 2001 From: Felix Roos Date: Sat, 28 May 2022 23:45:42 +0200 Subject: [PATCH] add dummy function with todo --- packages/core/splitLanes.mjs | 8 ++++++++ packages/core/test/splitLanes.test.mjs | 12 ++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 packages/core/splitLanes.mjs create mode 100644 packages/core/test/splitLanes.test.mjs diff --git a/packages/core/splitLanes.mjs b/packages/core/splitLanes.mjs new file mode 100644 index 00000000..5bfaddd7 --- /dev/null +++ b/packages/core/splitLanes.mjs @@ -0,0 +1,8 @@ +function splitLanes(haps) { + // TODO: split haps into multiple arrays so that no overlapping events are in the same array + // also make sure the lanes are packed as tight as possible + // use logic analogous to drawLine + return [haps]; +} + +export default splitLanes; diff --git a/packages/core/test/splitLanes.test.mjs b/packages/core/test/splitLanes.test.mjs new file mode 100644 index 00000000..da241586 --- /dev/null +++ b/packages/core/test/splitLanes.test.mjs @@ -0,0 +1,12 @@ +import { fastcat, stack, slowcat, silence, pure } from '../pattern.mjs'; +import { strict as assert } from 'assert'; +import splitLanes from '../splitLanes.mjs'; + +describe('splitLanes', () => { + it('should split', () => { + const haps = fastcat(0, stack(1, 2))._firstCycleValues; + + assert.deepStrictEqual(haps, [0, 1, 2]); + assert.deepStrictEqual(splitLanes([0, 1, 2]), [[0, 1, 2]]); + }); +});