BLUE
PHP 7.4.33
Path:
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/word-wrap
Run
Logout
Edit File
Size: 1.42 KB
Close
/var/www/uibuilder.cmshelp.dk/httpdocs/node_modules/word-wrap/index.js
Text
Base64
/*! * word-wrap <https://github.com/jonschlinkert/word-wrap> * * Copyright (c) 2014-2023, Jon Schlinkert. * Released under the MIT License. */ function trimEnd(str) { let lastCharPos = str.length - 1; let lastChar = str[lastCharPos]; while(lastChar === ' ' || lastChar === '\t') { lastChar = str[--lastCharPos]; } return str.substring(0, lastCharPos + 1); } function trimTabAndSpaces(str) { const lines = str.split('\n'); const trimmedLines = lines.map((line) => trimEnd(line)); return trimmedLines.join('\n'); } module.exports = function(str, options) { options = options || {}; if (str == null) { return str; } var width = options.width || 50; var indent = (typeof options.indent === 'string') ? options.indent : ' '; var newline = options.newline || '\n' + indent; var escape = typeof options.escape === 'function' ? options.escape : identity; var regexString = '.{1,' + width + '}'; if (options.cut !== true) { regexString += '([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)'; } var re = new RegExp(regexString, 'g'); var lines = str.match(re) || []; var result = indent + lines.map(function(line) { if (line.slice(-1) === '\n') { line = line.slice(0, line.length - 1); } return escape(line); }).join(newline); if (options.trim === true) { result = trimTabAndSpaces(result); } return result; }; function identity(str) { return str; }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 5
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
index.d.ts
1.21 KB
lrw-r--r--
2025-03-28 11:04:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
1.42 KB
lrw-r--r--
2025-03-28 11:04:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE
1.06 KB
lrw-r--r--
2025-03-28 11:04:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
1.68 KB
lrw-r--r--
2025-03-28 11:04:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
README.md
6.19 KB
lrw-r--r--
2025-03-28 11:04:36
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).