403Webshell
Server IP : 159.69.118.108  /  Your IP : 216.73.216.231
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ubuntu-4gb-fsn1-1 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 13:53:54 UTC 2025 aarch64
User : root ( 0)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/thread-self/root/lib/node_modules/pm2/node_modules/yamljs/src/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/root/lib/node_modules/pm2/node_modules/yamljs/src/Unescaper.coffee
Utils   = require './Utils'
Pattern = require './Pattern'

# Unescaper encapsulates unescaping rules for single and double-quoted YAML strings.
#
class Unescaper

    # Regex fragment that matches an escaped character in
    # a double quoted string.
    @PATTERN_ESCAPED_CHARACTER:     new Pattern '\\\\([0abt\tnvfre "\\/\\\\N_LP]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})';


    # Unescapes a single quoted string.
    #
    # @param [String]       value A single quoted string.
    #
    # @return [String]      The unescaped string.
    #
    @unescapeSingleQuotedString: (value) ->
        return value.replace(/\'\'/g, '\'')


    # Unescapes a double quoted string.
    #
    # @param [String]       value A double quoted string.
    #
    # @return [String]      The unescaped string.
    #
    @unescapeDoubleQuotedString: (value) ->
        @_unescapeCallback ?= (str) =>
            return @unescapeCharacter(str)

        # Evaluate the string
        return @PATTERN_ESCAPED_CHARACTER.replace value, @_unescapeCallback


    # Unescapes a character that was found in a double-quoted string
    #
    # @param [String]       value An escaped character
    #
    # @return [String]      The unescaped character
    #
    @unescapeCharacter: (value) ->
        ch = String.fromCharCode
        switch value.charAt(1)
            when '0'
                return ch(0)
            when 'a'
                return ch(7)
            when 'b'
                return ch(8)
            when 't'
                return "\t"
            when "\t"
                return "\t"
            when 'n'
                return "\n"
            when 'v'
                return ch(11)
            when 'f'
                return ch(12)
            when 'r'
                return ch(13)
            when 'e'
                return ch(27)
            when ' '
                return ' '
            when '"'
                return '"'
            when '/'
                return '/'
            when '\\'
                return '\\'
            when 'N'
                # U+0085 NEXT LINE
                return ch(0x0085)
            when '_'
                # U+00A0 NO-BREAK SPACE
                return ch(0x00A0)
            when 'L'
                # U+2028 LINE SEPARATOR
                return ch(0x2028)
            when 'P'
                # U+2029 PARAGRAPH SEPARATOR
                return ch(0x2029)
            when 'x'
                return Utils.utf8chr(Utils.hexDec(value.substr(2, 2)))
            when 'u'
                return Utils.utf8chr(Utils.hexDec(value.substr(2, 4)))
            when 'U'
                return Utils.utf8chr(Utils.hexDec(value.substr(2, 8)))
            else
                return ''

module.exports = Unescaper

Youez - 2016 - github.com/yon3zu
LinuXploit