instruments-chords 0.0.9 → 0.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ import { ChordQuality } from './types';
2
+ export declare function getQuality(root: string): ChordQuality[];
@@ -0,0 +1,7 @@
1
+ import { chords } from './chords';
2
+ export function getQuality(root) {
3
+ const chord = chords[root];
4
+ if (chord === undefined)
5
+ return [];
6
+ return Object.keys(chord);
7
+ }
@@ -0,0 +1,2 @@
1
+ import { ChordQuality, ChordVariantId } from './types';
2
+ export declare function getVariants(root: string, quality: ChordQuality): ChordVariantId[];
@@ -0,0 +1,10 @@
1
+ import { chords } from './chords';
2
+ export function getVariants(root, quality) {
3
+ const chord = chords[root];
4
+ if (chord === undefined)
5
+ return [];
6
+ const qualityObj = chord[quality];
7
+ if (qualityObj === undefined)
8
+ return [];
9
+ return Object.keys(qualityObj.variants);
10
+ }
package/dist/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
1
  export { getChord } from './getChord';
2
2
  export { getChordSvg } from './getChordSvg';
3
+ export { getVariants } from './getVariants';
4
+ export { getQuality } from './getQuality';
3
5
  export { chords } from './chords/index';
4
6
  export * from './types';
package/dist/index.js CHANGED
@@ -1,4 +1,6 @@
1
1
  export { getChord } from './getChord';
2
2
  export { getChordSvg } from './getChordSvg';
3
+ export { getVariants } from './getVariants';
4
+ export { getQuality } from './getQuality';
3
5
  export { chords } from './chords/index';
4
6
  export * from './types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instruments-chords",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "description": "Guitar chords database for developers",