UNPKG

@stringsync/vexml

Version:

MusicXML to Vexflow

38 lines (37 loc) 1.12 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.t = void 0; /** A class for creating schema types. */ class t { static defaultConfig(schema) { const config = {}; for (const key in schema) { config[key] = schema[key].defaultValue; } return config; } static string(opts) { const defaultValue = opts.defaultValue; const help = opts.help; return { type: 'string', defaultValue, help }; } static number(opts) { const defaultValue = opts.defaultValue; const help = opts.help; return { type: 'number', defaultValue, help }; } static boolean(opts) { const defaultValue = opts.defaultValue; const help = opts.help; return { type: 'boolean', defaultValue, help }; } static enum(opts) { const defaultValue = opts.defaultValue; const help = opts.help; return { type: 'enum', choices: opts.choices, defaultValue, help }; } constructor() { throw new Error('cannot instantiate t'); } } exports.t = t;