Skip to content

Commit 4d2db58

Browse files
🚧 progress: Add some assertions.
1 parent ab4c1e1 commit 4d2db58

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

src/0-core/_fast/_app3.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
import assert from 'assert';
2+
13
import {Empty, Single, Deep} from '../../3-tree/index.js';
24
import {delay} from '../../4-lazy/index.js';
35
import {app3} from '../concatenate/index.js';
46

57
export function _app3(A, B) {
8+
assert(A instanceof Deep);
9+
610
B = B.force();
711

812
if (B instanceof Empty) return A;

src/0-core/concatenate/app3.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
import {Empty, Single, Deep} from '../../3-tree/index.js';
1+
import assert from 'assert';
2+
3+
import {Tree, Empty, Single, Deep} from '../../3-tree/index.js';
24
import {delay} from '../../4-lazy/index.js';
35
import {_prepend, _append} from '../_fast/index.js';
46

57
export function app3(A, list, B) {
8+
assert(A instanceof Tree);
9+
assert(B instanceof Tree);
10+
611
A = A.force();
712
B = B.force();
813

src/0-core/concatenate/nodes.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
import assert from 'assert';
2+
13
import {node2, node3} from '../../2-node/index.js';
24

35
export function nodes(M, list) {
6+
assert(list.length >= 3 && list.length <= 12);
47
const out = [];
58

69
const n = list.length;

0 commit comments

Comments
 (0)