403Webshell
Server IP : 14.225.204.176  /  Your IP : 216.73.216.6
Web Server : nginx/1.24.0
System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64
User : root ( 0)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/node_modules/tcompare/dist/mjs/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/node_modules/tcompare/dist/mjs/match.js
import { Format } from './format.js';
import { Has } from './has.js';
export class Match extends Has {
    test() {
        const obj = this.object;
        const pattern = this.expect;
        return super.test() === true
            ? true
            : // failures that would also fail in the super class
                // but if they didn't pass, then should fail here, too
                pattern == null || obj == null
                    ? false
                    : pattern instanceof RegExp && obj instanceof RegExp
                        ? false
                        : Buffer.isBuffer(obj) && Buffer.isBuffer(pattern)
                            ? false
                            : typeof pattern === 'symbol'
                                ? false
                                : // ok, Match-specific stuff
                                    pattern instanceof RegExp
                                        ? pattern.test('' + obj)
                                        : typeof obj === 'string' &&
                                            typeof pattern === 'string' &&
                                            pattern
                                            ? obj.indexOf(pattern) !== -1
                                            : obj instanceof Date && typeof pattern === 'string'
                                                ? obj.getTime() === new Date(pattern).getTime()
                                                : pattern === BigInt
                                                    ? typeof obj === 'bigint'
                                                    : pattern === Buffer
                                                        ? Buffer.isBuffer(obj)
                                                        : pattern === Function
                                                            ? typeof obj === 'function'
                                                            : pattern === Number
                                                                ? typeof obj === 'number' &&
                                                                    obj === obj &&
                                                                    isFinite(obj)
                                                                : pattern === String
                                                                    ? typeof obj === 'string'
                                                                    : pattern === Symbol
                                                                        ? typeof obj === 'symbol'
                                                                        : pattern === Boolean
                                                                            ? typeof obj === 'boolean'
                                                                            : pattern === Map
                                                                                ? this.isMap()
                                                                                : pattern === Set
                                                                                    ? this.isSet()
                                                                                    : pattern === Object
                                                                                        ? obj && typeof obj === 'object'
                                                                                        : pattern === Array
                                                                                            ? new Format(obj).isArray()
                                                                                            : !this.isError() && pattern instanceof Error
                                                                                                ? false
                                                                                                : this.isError() &&
                                                                                                    ((pattern.message &&
                                                                                                        !new Match(obj.message, {
                                                                                                            expect: pattern.message,
                                                                                                        }).test()) ||
                                                                                                        (pattern.name &&
                                                                                                            !new Match(obj.name, {
                                                                                                                expect: pattern.name,
                                                                                                            }).test()))
                                                                                                    ? false
                                                                                                    : // standard deep matching stuff, same as parent, but not simple.
                                                                                                        this.isSet() && !(pattern instanceof Set)
                                                                                                            ? false
                                                                                                            : this.isMap() && !(pattern instanceof Map)
                                                                                                                ? false
                                                                                                                : typeof pattern === 'function' &&
                                                                                                                    typeof obj === 'object'
                                                                                                                    ? obj instanceof pattern
                                                                                                                    : typeof obj !== 'object' ||
                                                                                                                        typeof pattern !== 'object'
                                                                                                                        ? false
                                                                                                                        : 'COMPLEX';
    }
}
//# sourceMappingURL=match.js.map

Youez - 2016 - github.com/yon3zu
LinuXploit