How to use the tonal-pitches.isArr function in tonal-pitches

To help you get started, we’ve selected a few tonal-pitches examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github tonaljs / tonal / packages / tonal-arrays / dist / index.js View on Github external
function asArr(src) {
  return tonalPitches.isArr(src) ? src : typeof src === 'string' ? src.trim().split(SEP) : src === null || typeof src === 'undefined' ? [] : [src];
}
github tonaljs / tonal / packages / tonal-arrays / lib / index.js View on Github external
export function asArr (src) {
  return isArr(src) ? src
    : typeof src === 'string' ? src.trim().split(SEP)
    : (src === null || typeof src === 'undefined') ? []
    : [ src ]
}
github tonaljs / tonal / packages / tonal-collections / dist / index.js View on Github external
function asList (src) {
  return tonalPitches.isArr(src) ? src
    : typeof src === 'string' ? src.trim().split(SEP)
    : (src === null || typeof src === 'undefined') ? []
    : [ src ]
}