X7ROOT File Manager
Current Path:
/lib/node_modules/npm/node_modules/gauge
lib
/
node_modules
/
npm
/
node_modules
/
gauge
/
ðŸ“
..
📄
CHANGELOG.md
(6.23 KB)
📄
LICENSE
(751 B)
📄
README.md
(14.72 KB)
📄
base-theme.js
(395 B)
📄
error.js
(616 B)
📄
has-color.js
(292 B)
📄
index.js
(6.83 KB)
ðŸ“
node_modules
📄
package.json
(2.13 KB)
📄
plumbing.js
(1.24 KB)
📄
process.js
(89 B)
📄
progress-bar.js
(998 B)
📄
render-template.js
(5.6 KB)
📄
set-immediate.js
(139 B)
📄
set-interval.js
(93 B)
📄
spin.js
(105 B)
📄
template-item.js
(1.86 KB)
📄
theme-set.js
(3.61 KB)
📄
themes.js
(1.51 KB)
📄
wide-truncate.js
(828 B)
Editing: progress-bar.js
'use strict' var validate = require('aproba') var renderTemplate = require('./render-template.js') var wideTruncate = require('./wide-truncate') var stringWidth = require('string-width') module.exports = function (theme, width, completed) { validate('ONN', [theme, width, completed]) if (completed < 0) completed = 0 if (completed > 1) completed = 1 if (width <= 0) return '' var sofar = Math.round(width * completed) var rest = width - sofar var template = [ {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} ] return renderTemplate(width, template, theme) } // lodash's way of repeating function repeat (string, width) { var result = '' var n = width do { if (n % 2) { result += string } n = Math.floor(n / 2) /*eslint no-self-assign: 0*/ string += string } while (n && stringWidth(result) < width) return wideTruncate(result, width) }
Upload File
Create Folder