2022-11-18 21:38:41 +01:00

39 lines
772 B
JavaScript

var options = {
add: false,
visible: {
min: 1,
max: 3
}
};
export default options;
/**
* Extend shorthand options.
*
* @param {object} options The options to extend.
* @return {object} The extended options.
*/
export function extendShorthandOptions(options) {
if (typeof options == 'boolean') {
options = {
add: options
};
}
if (typeof options == 'number') {
options = {
add: true,
visible: options
};
}
if (typeof options != 'object') {
options = {};
}
if (typeof options.visible == 'number') {
options.visible = {
min: options.visible,
max: options.visible
};
}
return options;
}
;