Linux premium71.web-hosting.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64
LiteSpeed
Server IP : 198.187.29.8 & Your IP : 3.148.197.73
Domains :
Cant Read [ /etc/named.conf ]
User : cleahvkv
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
lib /
node_modules /
npm /
node_modules /
ansi-align /
Delete
Unzip
Name
Size
Permission
Date
Action
CHANGELOG.md
1017
B
-rw-r--r--
2021-03-10 14:36
LICENSE
731
B
-rw-r--r--
2021-03-10 14:36
README.md
2.78
KB
-rw-r--r--
2021-03-10 14:36
index.js
1.3
KB
-rw-r--r--
2021-03-10 14:36
package.json
1.65
KB
-rw-r--r--
2021-03-10 14:36
Save
Rename
'use strict' const stringWidth = require('string-width') function ansiAlign (text, opts) { if (!text) return text opts = opts || {} const align = opts.align || 'center' // short-circuit `align: 'left'` as no-op if (align === 'left') return text const split = opts.split || '\n' const pad = opts.pad || ' ' const widthDiffFn = align !== 'right' ? halfDiff : fullDiff let returnString = false if (!Array.isArray(text)) { returnString = true text = String(text).split(split) } let width let maxWidth = 0 text = text.map(function (str) { str = String(str) width = stringWidth(str) maxWidth = Math.max(width, maxWidth) return { str, width } }).map(function (obj) { return new Array(widthDiffFn(maxWidth, obj.width) + 1).join(pad) + obj.str }) return returnString ? text.join(split) : text } ansiAlign.left = function left (text) { return ansiAlign(text, { align: 'left' }) } ansiAlign.center = function center (text) { return ansiAlign(text, { align: 'center' }) } ansiAlign.right = function right (text) { return ansiAlign(text, { align: 'right' }) } module.exports = ansiAlign function halfDiff (maxWidth, curWidth) { return Math.floor((maxWidth - curWidth) / 2) } function fullDiff (maxWidth, curWidth) { return maxWidth - curWidth }