wide-text
Version:
Create w i d e t e x t from normal text
20 lines (19 loc) • 600 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createWideText = void 0;
/**
* Create wide text from normal text
* @param text Input text
* @param options Options
*/
function createWideText(text, options = {}) {
const { charSep = 1, wordSep = 2, } = options;
const actualCharSep = ' '.repeat(charSep);
const actualWordSep = ' '.repeat(wordSep);
return text
.split(' ')
.map(word => Array.from(word).join(actualCharSep))
.join(actualWordSep);
}
exports.createWideText = createWideText;
exports.default = createWideText;