aboutsummaryrefslogtreecommitdiff
path: root/sandbox/testAppNevena/Front/node_modules/gauge/lib/wide-truncate.js
diff options
context:
space:
mode:
authorNevena Bojovic <nenabojov@gmail.com>2022-03-01 22:05:25 +0100
committerNevena Bojovic <nenabojov@gmail.com>2022-03-01 22:05:25 +0100
commit6555fb80fdd8f6a5d201efadec3189d1244830a0 (patch)
treec1aa1c5aedc634ad1ea7fad4847884d559b51290 /sandbox/testAppNevena/Front/node_modules/gauge/lib/wide-truncate.js
parent7d3640f824f46490b47bd95f1c5a16644f712068 (diff)
Izbrisala bin, obj i node-modules.
Diffstat (limited to 'sandbox/testAppNevena/Front/node_modules/gauge/lib/wide-truncate.js')
-rw-r--r--sandbox/testAppNevena/Front/node_modules/gauge/lib/wide-truncate.js31
1 files changed, 0 insertions, 31 deletions
diff --git a/sandbox/testAppNevena/Front/node_modules/gauge/lib/wide-truncate.js b/sandbox/testAppNevena/Front/node_modules/gauge/lib/wide-truncate.js
deleted file mode 100644
index 5284a699..00000000
--- a/sandbox/testAppNevena/Front/node_modules/gauge/lib/wide-truncate.js
+++ /dev/null
@@ -1,31 +0,0 @@
-'use strict'
-var stringWidth = require('string-width')
-var stripAnsi = require('strip-ansi')
-
-module.exports = wideTruncate
-
-function wideTruncate (str, target) {
- if (stringWidth(str) === 0) {
- return str
- }
- if (target <= 0) {
- return ''
- }
- if (stringWidth(str) <= target) {
- return str
- }
-
- // We compute the number of bytes of ansi sequences here and add
- // that to our initial truncation to ensure that we don't slice one
- // that we want to keep in half.
- var noAnsi = stripAnsi(str)
- var ansiSize = str.length + noAnsi.length
- var truncated = str.slice(0, target + ansiSize)
-
- // we have to shrink the result to account for our ansi sequence buffer
- // (if an ansi sequence was truncated) and double width characters.
- while (stringWidth(truncated) > target) {
- truncated = truncated.slice(0, -1)
- }
- return truncated
-}