GRAYBYTE WORDPRESS FILE MANAGER2892

Server IP : 198.54.121.189 / Your IP : 216.73.216.140
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /lib/node_modules/npm/node_modules/cmd-shim/lib/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /lib/node_modules/npm/node_modules/cmd-shim/lib//to-batch-syntax.js
exports.replaceDollarWithPercentPair = replaceDollarWithPercentPair
exports.convertToSetCommand = convertToSetCommand
exports.convertToSetCommands = convertToSetCommands

function convertToSetCommand(key, value) {
    var line = ""
    key = key || ""
    key = key.trim()
    value = value || ""
    value = value.trim()
    if(key && value && value.length > 0) {
        line = "@SET " + key + "=" + replaceDollarWithPercentPair(value) + "\r\n"
    }
    return line
}

function extractVariableValuePairs(declarations) {
    var pairs = {}
    declarations.map(function(declaration) {
        var split = declaration.split("=")
        pairs[split[0]]=split[1]
    })
    return pairs
}

function convertToSetCommands(variableString) {
    var variableValuePairs = extractVariableValuePairs(variableString.split(" "))
    var variableDeclarationsAsBatch = ""
    Object.keys(variableValuePairs).forEach(function (key) {
        variableDeclarationsAsBatch += convertToSetCommand(key, variableValuePairs[key])
    })
    return variableDeclarationsAsBatch
}

function replaceDollarWithPercentPair(value) {
    var dollarExpressions = /\$\{?([^\$@#\?\- \t{}:]+)\}?/g
    var result = ""
    var startIndex = 0
    do {
        var match = dollarExpressions.exec(value)
        if(match) {
            var betweenMatches = value.substring(startIndex, match.index) || ""
            result +=  betweenMatches + "%" + match[1] + "%"
            startIndex = dollarExpressions.lastIndex
        }
    } while (dollarExpressions.lastIndex > 0)
    result += value.substr(startIndex)
    return result
}



[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
January 01 1970 00:00:00
root / root
0
to-batch-syntax.js
1.563 KB
March 10 2021 14:36:40
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF