Comparing version 1.1.1 to 1.1.2
@@ -239,2 +239,17 @@ (function (global, factory) { | ||
/** | ||
* ------------ | ||
* Housekeeping | ||
* ------------ | ||
*/ | ||
function getModes() { | ||
var modes = []; | ||
modes.push(EQ_TEMP_STR); | ||
for (var key in justTuningSystems) { | ||
if (Object.prototype.hasOwnProperty.call(justTuningSystems, key)) { | ||
modes.push(key); | ||
} | ||
} | ||
return modes; | ||
} | ||
/** | ||
* ------------ | ||
@@ -455,2 +470,3 @@ * Main module functions | ||
getAllOctaveJustIntervals: getAllOctaveJustIntervals, | ||
getModes: getModes, | ||
justTuningSystems: justTuningSystems, | ||
@@ -457,0 +473,0 @@ CHROMATIC_SCALE: CHROMATIC_SCALE, |
{ | ||
"name": "freqi", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A library that generates musical frequencies for use with the Web Audio API", | ||
@@ -5,0 +5,0 @@ "main": "freqi.js", |
@@ -293,2 +293,19 @@ /* | ||
/** | ||
* ------------ | ||
* Housekeeping | ||
* ------------ | ||
*/ | ||
function getModes(): array { | ||
const modes = []; | ||
modes.push(EQ_TEMP_STR); | ||
for (const key in justTuningSystems) { | ||
if (Object.prototype.hasOwnProperty.call(justTuningSystems, key)) { | ||
modes.push(key); | ||
} | ||
} | ||
return modes; | ||
} | ||
/** | ||
* ------------ | ||
@@ -508,4 +525,5 @@ * Main module functions | ||
getAllOctaveJustIntervals, | ||
getModes, | ||
justTuningSystems, | ||
CHROMATIC_SCALE, | ||
}; |
@@ -718,1 +718,8 @@ 'use strict'; | ||
}); | ||
describe('getModes', function() { | ||
it('should return an array the length of justTuningSystems plus the default (eqTemp)', function() { | ||
const justTuningSystemsLength = Object.keys(freqi.justTuningSystems).length; | ||
expect(freqi.getModes().length).to.equal(justTuningSystemsLength + 1); | ||
}); | ||
}); |
71385
1789