UNPKG

validate-note

Version:

🎼 Validates a note (scientific pitch notation) and throws errors if needed

18 lines (11 loc) • 278 B
// @flow import notes from '../data/notes'; type result = { signature: string, letter: string }; export default (letter: string, signature: string): result => { signature = `#`; letter = notes[notes.indexOf(letter) - 1].charAt(0); return {signature, letter}; };