frontend/.pnpm-store/v3/files/26/f213bfab7663e52a957ca988d361965f2759049c7698e4386a3d037d7da47eebbacf30d8dfd2c4d773f93566fd61a1b639f5621dbff9c003f08cce9971f5d0

34 lines
745 B
Plaintext

import chalk from 'chalk';
import figures from 'figures';
/**
* Separator object
* Used to space/separate choices group
* @constructor
* @param {String} line Separation line content (facultative)
*/
export default class Separator {
constructor(line) {
this.type = 'separator';
this.line = chalk.dim(line || new Array(15).join(figures.line));
}
/**
* Helper function returning false if object is a separator
* @param {Object} obj object to test against
* @return {Boolean} `false` if object is a separator
*/
static exclude(obj) {
return obj.type !== 'separator';
}
/**
* Stringify separator
* @return {String} the separator display string
*/
toString() {
return this.line;
}
}