API / @aionbuilders/nabu

formatChord

Function Stability: stable

Format a chord for display, per platform. macOS: ⌃⌥⇧⌘ + key, no separator (⌘⇧Z, ⌘↩). Elsewhere: Ctrl+Alt+Shift+Meta+Key (Ctrl+Shift+Z, Ctrl+Enter).

Related guide: Commands and keymap →

Signature

TypeScript
import { formatChord } from '@aionbuilders/nabu';
TypeScript
function formatChord(chord: string | Chord, options?: object): string

Parameters

Parameters of formatChord
ParameterTypeDefaultDescription
chordstring | Chordn/a

a chord string (parsed with platform) or a parsed chord

optionsoptionalobject{}n/a
options.platformoptionalPlatformn/an/a

Returns

string

'' for an invalid chord string

Source: src/lib/utils/keys.js:192