Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
options = options || {};
const min = options.min_font || 10;
const max = options.max_font || 20;
const orderby = options.orderby || 'name';
const order = options.order || 1;
const unit = options.unit || 'px';
let color = options.color;
const { transform } = options;
const separator = options.separator || ' ';
const result = [];
let startColor, endColor;
if (color) {
startColor = new Color(options.start_color);
endColor = new Color(options.end_color);
if (!startColor || !endColor) color = false;
}
// Sort the tags
if (orderby === 'random' || orderby === 'rand') {
tags = tags.random();
} else {
tags = tags.sort(orderby, order);
}
// Limit the number of tags
if (options.amount) {
tags = tags.limit(options.amount);
}
if (!tags || !tags.length) return '';
options = options || {};
const min = options.min_font || 10;
const max = options.max_font || 20;
const orderby = options.orderby || 'name';
const order = options.order || 1;
const unit = options.unit || 'px';
let color = options.color;
const { transform } = options;
const separator = options.separator || ' ';
const result = [];
let startColor, endColor;
if (color) {
startColor = new Color(options.start_color);
endColor = new Color(options.end_color);
if (!startColor || !endColor) color = false;
}
// Sort the tags
if (orderby === 'random' || orderby === 'rand') {
tags = tags.random();
} else {
tags = tags.sort(orderby, order);
}
// Limit the number of tags
if (options.amount) {
tags = tags.limit(options.amount);
}