preact-material-components
Version:
preact wrapper for "Material Components for the web"
22 lines (18 loc) • 450 B
JavaScript
;
module.exports = function(usage, description, init, aliases) {
if (Array.isArray(init)) {
aliases = init;
init = undefined;
}
if (aliases && Array.isArray(aliases)) {
usage = [].concat([usage], aliases);
}
// Register command to global scope
this.details.commands.push({
usage,
description,
init: typeof init === 'function' ? init : false
});
// Allow chaining of .command()
return this;
};