Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function transpose(a, b) {
if (arguments.length === 1) return function (b) {
return transpose(a, b);
};
var pa = tonalPitches.asPitch(a);
var pb = tonalPitches.asPitch(b);
var r = tonalPitches.isIvlPitch(pa) ? trBy(pa, pb) : tonalPitches.isIvlPitch(pb) ? trBy(pb, pa) : null;
return a === pa && b === pb ? r : tonalPitches.toPitchStr(r);
}
export function transpose (a, b) {
if (arguments.length === 1) return (b) => transpose(a, b)
const pa = asPitch(a)
const pb = asPitch(b)
const r = isIvlPitch(pa) ? trBy(pa, pb)
: isIvlPitch(pb) ? trBy(pb, pa) : null
return a === pa && b === pb ? r : toPitchStr(r)
}