fix test
This commit is contained in:
parent
9cdba1a50e
commit
89b7eac789
3 changed files with 5 additions and 5 deletions
|
|
@ -126,6 +126,8 @@ export const lcm = (...fractions) => {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const isFraction = (x) => x instanceof Fraction;
|
||||||
|
|
||||||
fraction._original = Fraction;
|
fraction._original = Fraction;
|
||||||
|
|
||||||
export default fraction;
|
export default fraction;
|
||||||
|
|
|
||||||
|
|
@ -5,8 +5,7 @@ This program is free software: you can redistribute it and/or modify it under th
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import TimeSpan from './timespan.mjs';
|
import TimeSpan from './timespan.mjs';
|
||||||
import Fraction, { lcm } from './fraction.mjs';
|
import Fraction, {isFraction, lcm } from './fraction.mjs';
|
||||||
import FractionClass from 'fraction.js';
|
|
||||||
import Hap from './hap.mjs';
|
import Hap from './hap.mjs';
|
||||||
import State from './state.mjs';
|
import State from './state.mjs';
|
||||||
import { unionWithObj } from './value.mjs';
|
import { unionWithObj } from './value.mjs';
|
||||||
|
|
@ -27,7 +26,6 @@ import {
|
||||||
} from './util.mjs';
|
} from './util.mjs';
|
||||||
import drawLine from './drawLine.mjs';
|
import drawLine from './drawLine.mjs';
|
||||||
import { logger } from './logger.mjs';
|
import { logger } from './logger.mjs';
|
||||||
import fraction from './fraction.mjs';
|
|
||||||
|
|
||||||
let stringParser;
|
let stringParser;
|
||||||
|
|
||||||
|
|
@ -1001,7 +999,7 @@ addToPrototype('weaveWith', function (t, ...funcs) {
|
||||||
// compose matrix functions
|
// compose matrix functions
|
||||||
|
|
||||||
function _nonArrayObject(x) {
|
function _nonArrayObject(x) {
|
||||||
return !Array.isArray(x) && typeof x === 'object' && !(x instanceof FractionClass);
|
return !Array.isArray(x) && typeof x === 'object' && !isFraction(x);
|
||||||
}
|
}
|
||||||
function _composeOp(a, b, func) {
|
function _composeOp(a, b, func) {
|
||||||
if (_nonArrayObject(a) || _nonArrayObject(b)) {
|
if (_nonArrayObject(a) || _nonArrayObject(b)) {
|
||||||
|
|
|
||||||
|
|
@ -877,7 +877,7 @@ describe('Pattern', () => {
|
||||||
.squeezeJoin()
|
.squeezeJoin()
|
||||||
.queryArc(3, 4)
|
.queryArc(3, 4)
|
||||||
.map((x) => x.value),
|
.map((x) => x.value),
|
||||||
).toStrictEqual([3]);
|
).toStrictEqual([Fraction(3)]);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe('ply', () => {
|
describe('ply', () => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue