| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.makeProgressBar = void 0; | |
| const renderer_1 = require("@remotion/renderer"); | |
| const chalk_1 = require("./chalk"); | |
| const full = '━'; | |
| const half = '╸'; | |
| const half_right = '╺'; | |
| const totalBars = 18; | |
| const makeProgressBar = (percentage, noColor) => { | |
| const color = noColor ? false : renderer_1.RenderInternals.isColorSupported(); | |
| const barsToShow = Math.floor(percentage * totalBars); | |
| const extraBar = (percentage * totalBars) % barsToShow; | |
| const grayBars = totalBars - barsToShow; | |
| const showHalf = extraBar > 0.5; | |
| const base = full.repeat(barsToShow) + (showHalf ? half : ''); | |
| const gray = (renderer_1.RenderInternals.isColorSupported() ? full : ' ') | |
| .repeat(grayBars - (showHalf ? 1 : 0)) | |
| .split(''); | |
| if (!showHalf && barsToShow > 0 && gray.length > 0 && color) { | |
| gray[0] = half_right; | |
| } | |
| if (!color) { | |
| return `${base}${gray.join('')}`; | |
| } | |
| return `${chalk_1.chalk.blue(base)}${chalk_1.chalk.dim(gray.join(''))}`; | |
| }; | |
| exports.makeProgressBar = makeProgressBar; | |
Xet Storage Details
- Size:
- 1.12 kB
- Xet hash:
- 45cca7d8d8249332ffb3f67b9ab0ee78c7f163a05061f27ca847e7da8f591f2b
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.