UNPKG

validate-chord

Version:

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

10 lines (7 loc) • 205 B
"use strict"; exports.__esModule = true; exports.default = function (chord) { if (!isNaN(chord.charAt(1))) return chord.slice(0, 2); return chord.slice(0, 3); }; module.exports = exports["default"];