| Server IP : 138.197.176.125 / Your IP : 216.73.217.54 Web Server : Apache/2.4.41 (Ubuntu) System : Linux SuiteCRM-8 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.3.19 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/self/root/lib/nodejs/qw/ |
Upload File : |
'use strict'
module.exports = qw
function appendLast (arr, str) {
var last = arr.length - 1
if (last < 0) {
arr.push(str)
} else {
var lastValue = String(arr[last])
return arr[last] = lastValue + String(str)
}
}
function qw () {
const args = Object.assign([], arguments[0])
const values = [].slice.call(arguments, 1)
const words = []
let lastWordWasValue = false
while (args.length) {
const arg = args.shift()
const concatValue = arg.length === 0 || arg.slice(-1) !== ' '
if (arg.trim() !== '') {
const theseWords = arg.replace(/^\s+|\s+$/g, '').replace(/\s+/g, ' ').split(/ /)
if (lastWordWasValue && arg[0] !== ' ') {
appendLast(words, theseWords.shift())
}
words.push.apply(words, theseWords)
}
if (values.length) {
const val = values.shift()
if (concatValue) {
appendLast(words, val)
} else {
words.push(val)
}
lastWordWasValue = true
} else {
lastWordWasValue = false
}
}
return words
}