$45 GRAYBYTE WORDPRESS FILE MANAGER $90

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/gauge/

HOME
Current File : /opt/alt/alt-nodejs8/root/usr/lib/node_modules/npm/node_modules.bundled/gauge//template-item.js
'use strict'
var stringWidth = require('string-width')

module.exports = TemplateItem

function isPercent (num) {
  if (typeof num !== 'string') return false
  return num.slice(-1) === '%'
}

function percent (num) {
  return Number(num.slice(0, -1)) / 100
}

function TemplateItem (values, outputLength) {
  this.overallOutputLength = outputLength
  this.finished = false
  this.type = null
  this.value = null
  this.length = null
  this.maxLength = null
  this.minLength = null
  this.kerning = null
  this.align = 'left'
  this.padLeft = 0
  this.padRight = 0
  this.index = null
  this.first = null
  this.last = null
  if (typeof values === 'string') {
    this.value = values
  } else {
    for (var prop in values) this[prop] = values[prop]
  }
  // Realize percents
  if (isPercent(this.length)) {
    this.length = Math.round(this.overallOutputLength * percent(this.length))
  }
  if (isPercent(this.minLength)) {
    this.minLength = Math.round(this.overallOutputLength * percent(this.minLength))
  }
  if (isPercent(this.maxLength)) {
    this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength))
  }
  return this
}

TemplateItem.prototype = {}

TemplateItem.prototype.getBaseLength = function () {
  var length = this.length
  if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) {
    length = stringWidth(this.value)
  }
  return length
}

TemplateItem.prototype.getLength = function () {
  var length = this.getBaseLength()
  if (length == null) return null
  return length + this.padLeft + this.padRight
}

TemplateItem.prototype.getMaxLength = function () {
  if (this.maxLength == null) return null
  return this.maxLength + this.padLeft + this.padRight
}

TemplateItem.prototype.getMinLength = function () {
  if (this.minLength == null) return null
  return this.minLength + this.padLeft + this.padRight
}


Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 8.02 AM
root / root
0755
node_modules
--
31 Aug 2024 8.02 AM
root / root
0755
CHANGELOG.md
6.227 KB
28 Sep 2021 5.29 PM
root / root
0644
LICENSE
0.733 KB
28 Sep 2021 5.29 PM
root / root
0644
README.md
14.72 KB
28 Sep 2021 5.29 PM
root / root
0644
base-theme.js
0.386 KB
28 Sep 2021 5.29 PM
root / root
0644
error.js
0.602 KB
28 Sep 2021 5.29 PM
root / root
0644
has-color.js
0.285 KB
28 Sep 2021 5.29 PM
root / root
0644
index.js
6.835 KB
28 Sep 2021 5.29 PM
root / root
0644
package.json
2.13 KB
28 Sep 2021 5.29 PM
root / root
0644
plumbing.js
1.239 KB
28 Sep 2021 5.29 PM
root / root
0644
process.js
0.087 KB
28 Sep 2021 5.29 PM
root / root
0644
progress-bar.js
0.975 KB
28 Sep 2021 5.29 PM
root / root
0644
render-template.js
5.604 KB
28 Sep 2021 5.29 PM
root / root
0644
set-immediate.js
0.136 KB
28 Sep 2021 5.29 PM
root / root
0644
set-interval.js
0.091 KB
28 Sep 2021 5.29 PM
root / root
0644
spin.js
0.103 KB
28 Sep 2021 5.29 PM
root / root
0644
template-item.js
1.859 KB
28 Sep 2021 5.29 PM
root / root
0644
theme-set.js
3.606 KB
28 Sep 2021 5.29 PM
root / root
0644
themes.js
1.507 KB
28 Sep 2021 5.29 PM
root / root
0644
wide-truncate.js
0.809 KB
28 Sep 2021 5.29 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF