mirror of
https://github.com/eliasstepanik/strudel-docker.git
synced 2026-01-11 13:48:34 +00:00
Tidy test and console logs
This commit is contained in:
parent
b370c405da
commit
3ae6443c59
@ -714,21 +714,6 @@ export class Pattern {
|
||||
_velocity(velocity) {
|
||||
return this._withContext((context) => ({ ...context, velocity: (context.velocity || 1) * velocity }));
|
||||
}
|
||||
|
||||
add(other) {
|
||||
return this._asNumber()._opLeft(other, (a) => (b) => a + b);
|
||||
}
|
||||
|
||||
sub(other) {
|
||||
return this._asNumber()._opLeft(other, (a) => (b) => a - b);
|
||||
}
|
||||
mul(other) {
|
||||
return this._asNumber()._opLeft(other, (a) => (b) => a * b);
|
||||
}
|
||||
|
||||
div(other) {
|
||||
return this._asNumber()._opLeft(other, (a) => (b) => a / b);
|
||||
}
|
||||
}
|
||||
|
||||
// pattern composers
|
||||
@ -741,7 +726,6 @@ const composers = {
|
||||
};
|
||||
|
||||
for (const [name, op] of Object.entries(composers)) {
|
||||
console.log(`Adding ${name}`);
|
||||
Pattern.prototype[name] = function (other) {
|
||||
return op[1](this)._opLeft(other, op[0]);
|
||||
};
|
||||
|
||||
@ -161,11 +161,11 @@ describe('Pattern', function () {
|
||||
assert.equal(pure(3).div(pure(2)).firstCycle()[0].value, 1.5);
|
||||
});
|
||||
});
|
||||
describe('union()', function () {
|
||||
it('Can union things', function () {
|
||||
describe('set()', function () {
|
||||
it('Can set things', function () {
|
||||
assert.deepStrictEqual(
|
||||
pure({ a: 4, b: 6 })
|
||||
.union(pure({ c: 7 }))
|
||||
.set(pure({ c: 7 }))
|
||||
.firstCycle()[0].value,
|
||||
{ a: 4, b: 6, c: 7 },
|
||||
);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user