????

Your IP : 216.73.216.207


Current Path : C:/inetpub/vhost/invest.gdtsolutions.vn/api/node_modules/typeorm/platform/
Upload File :
Current File : C:/inetpub/vhost/invest.gdtsolutions.vn/api/node_modules/typeorm/platform/PlatformTools.js.map

{"version":3,"sources":["../../src/platform/PlatformTools.ts"],"names":[],"mappings":";;;;AAAA,mDAA4B;AAC5B,+CAAwB;AACxB,4DAA2B;AAC3B,0DAAyB;AACzB,iDAAgD;AAEhD,yBAA+B;AAAtB,gGAAA,UAAU,OAAA;AACnB,iCAAqC;AAA5B,sGAAA,YAAY,OAAA;AACrB,iCAA2C;AAAlC,kGAAA,QAAQ,OAAA;AAAE,kGAAA,QAAQ,OAAA;AAE3B;;GAEG;AACH,MAAa,aAAa;IAMtB;;OAEG;IACH,MAAM,CAAC,iBAAiB;QACpB,OAAO,MAAM,CAAA;IACjB,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,IAAI,CAAC,IAAY;QACpB,2HAA2H;QAC3H,8FAA8F;QAC9F,kCAAkC;QAElC,IAAI,CAAC;YACD,wEAAwE;YACxE,QAAQ,IAAI,EAAE,CAAC;gBACX;;mBAEG;gBACH,KAAK,SAAS;oBACV,OAAO,OAAO,CAAC,uBAAuB,CAAC,CAAA;gBAE3C;;mBAEG;gBACH,KAAK,SAAS;oBACV,OAAO,OAAO,CAAC,SAAS,CAAC,CAAA;gBAE7B;;mBAEG;gBACH,KAAK,kBAAkB;oBACnB,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAA;gBAEtC,KAAK,mCAAmC;oBACpC,OAAO,OAAO,CAAC,mCAAmC,CAAC,CAAA;gBAEvD,KAAK,UAAU;oBACX,OAAO,OAAO,CAAC,UAAU,CAAC,CAAA;gBAE9B;;mBAEG;gBACH,KAAK,OAAO;oBACR,OAAO,OAAO,CAAC,OAAO,CAAC,CAAA;gBAE3B,KAAK,QAAQ;oBACT,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAA;gBAE5B;;mBAEG;gBACH,KAAK,U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AG,CAAC,OAAe;QACtB,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAA;IACzC,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,IAAS;QACjB,OAAO,eAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC3B,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,KAAU;QACnB,OAAO,eAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;IAC3B,CAAC;IAED,MAAM,CAAC,IAAI,CAAC,OAAe;QACvB,OAAO,eAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;IAChC,CAAC;IAED,MAAM,CAAC,SAAS,CAAC,MAAc,EAAE,GAAS;QACtC,OAAO,CAAC,GAAG,CAAC,eAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;QACtC,IAAI,GAAG;YAAE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;IAC/B,CAAC;;AA3PL,sCA4PC;AA3PG;;GAEG;AACI,kBAAI,GAAuB,MAAM,CAAA","file":"PlatformTools.js","sourcesContent":["import * as path from \"path\"\nimport * as fs from \"fs\"\nimport dotenv from \"dotenv\"\nimport chalk from \"chalk\"\nimport { highlight, Theme } from \"cli-highlight\"\n\nexport { ReadStream } from \"fs\"\nexport { EventEmitter } from \"events\"\nexport { Readable, Writable } from \"stream\"\n\n/**\n * Platform-specific tools.\n */\nexport class PlatformTools {\n    /**\n     * Type of the currently running platform.\n     */\n    static type: \"browser\" | \"node\" = \"node\"\n\n    /**\n     * Gets global variable where global stuff can be stored.\n     */\n    static getGlobalVariable(): any {\n        return global\n    }\n\n    /**\n     * Loads (\"require\"-s) given file or package.\n     * This operation only supports on node platform\n     */\n    static load(name: string): any {\n        // if name is not absolute or relative, then try to load package from the node_modules of the directory we are currently in\n        // this is useful when we are using typeorm package globally installed and it accesses drivers\n        // that are not installed globally\n\n        try {\n            // switch case to explicit require statements for webpack compatibility.\n            switch (name) {\n                /**\n                 * spanner\n                 */\n                case \"spanner\":\n                    return require(\"@google-cloud/spanner\")\n\n                /**\n                 * mongodb\n                 */\n                case \"mongodb\":\n                    return require(\"mongodb\")\n\n                /**\n                 * hana\n                 */\n                case \"@sap/hana-client\":\n                    return require(\"@sap/hana-client\")\n\n                case \"@sap/hana-client/extension/Stream\":\n                    return require(\"@sap/hana-client/extension/Stream\")\n\n                case \"hdb-pool\":\n                    return require(\"hdb-pool\")\n\n                /**\n                 * mysql\n                 */\n                case \"mysql\":\n                    return require(\"mysql\")\n\n                case \"mysql2\":\n                    return require(\"mysql2\")\n\n                /**\n                 * oracle\n                 */\n                case \"oracledb\":\n                    return require(\"oracledb\")\n\n                /**\n                 * postgres\n                 */\n                case \"pg\":\n                    return require(\"pg\")\n\n                case \"pg-native\":\n                    return require(\"pg-native\")\n\n                case \"pg-query-stream\":\n                    return require(\"pg-query-stream\")\n\n                case \"typeorm-aurora-data-api-driver\":\n                    return require(\"typeorm-aurora-data-api-driver\")\n\n                /**\n                 * redis\n                 */\n                case \"redis\":\n                    return require(\"redis\")\n\n                case \"ioredis\":\n                    return require(\"ioredis\")\n\n                /**\n                 * better-sqlite3\n                 */\n                case \"better-sqlite3\":\n                    return require(\"better-sqlite3\")\n\n                /**\n                 * sqlite\n                 */\n                case \"sqlite3\":\n                    return require(\"sqlite3\")\n\n                /**\n                 * sql.js\n                 */\n                case \"sql.js\":\n                    return require(\"sql.js\")\n\n                /**\n                 * sqlserver\n                 */\n                case \"mssql\":\n                    return require(\"mssql\")\n\n                /**\n                 * react-native-sqlite\n                 */\n                case \"react-native-sqlite-storage\":\n                    return require(\"react-native-sqlite-storage\")\n            }\n        } catch (err) {\n            return require(path.resolve(\n                process.cwd() + \"/node_modules/\" + name,\n            ))\n        }\n\n        // If nothing above matched and we get here, the package was not listed within PlatformTools\n        // and is an Invalid Package.  To make it explicit that this is NOT the intended use case for\n        // PlatformTools.load - it's not just a way to replace `require` all willy-nilly - let's throw\n        // an error.\n        throw new TypeError(`Invalid Package for PlatformTools.load: ${name}`)\n    }\n\n    /**\n     * Normalizes given path. Does \"path.normalize\" and replaces backslashes with forward slashes on Windows.\n     */\n    static pathNormalize(pathStr: string): string {\n        let normalizedPath = path.normalize(pathStr)\n        if (process.platform === \"win32\")\n            normalizedPath = normalizedPath.replace(/\\\\/g, \"/\")\n        return normalizedPath\n    }\n\n    /**\n     * Gets file extension. Does \"path.extname\".\n     */\n    static pathExtname(pathStr: string): string {\n        return path.extname(pathStr)\n    }\n\n    /**\n     * Resolved given path. Does \"path.resolve\".\n     */\n    static pathResolve(pathStr: string): string {\n        return path.resolve(pathStr)\n    }\n\n    /**\n     * Synchronously checks if file exist. Does \"fs.existsSync\".\n     */\n    static fileExist(pathStr: string): boolean {\n        return fs.existsSync(pathStr)\n    }\n\n    static readFileSync(filename: string): Buffer {\n        return fs.readFileSync(filename)\n    }\n\n    static appendFileSync(filename: string, data: any): void {\n        fs.appendFileSync(filename, data)\n    }\n\n    static async writeFile(path: string, data: any): Promise<void> {\n        return new Promise<void>((ok, fail) => {\n            fs.writeFile(path, data, (err) => {\n                if (err) fail(err)\n                ok()\n            })\n        })\n    }\n\n    /**\n     * Loads a dotenv file into the environment variables.\n     *\n     * @param path The file to load as a dotenv configuration\n     */\n    static dotenv(pathStr: string): void {\n        dotenv.config({ path: pathStr })\n    }\n\n    /**\n     * Gets environment variable.\n     */\n    static getEnvVariable(name: string): any {\n        return process.env[name]\n    }\n\n    /**\n     * Highlights sql string to be print in the console.\n     */\n    static highlightSql(sql: string) {\n        const theme: Theme = {\n            keyword: chalk.blueBright,\n            literal: chalk.blueBright,\n            string: chalk.white,\n            type: chalk.magentaBright,\n            built_in: chalk.magentaBright,\n            comment: chalk.gray,\n        }\n        return highlight(sql, { theme: theme, language: \"sql\" })\n    }\n\n    /**\n     * Highlights json string to be print in the console.\n     */\n    static highlightJson(json: string) {\n        return highlight(json, { language: \"json\" })\n    }\n\n    /**\n     * Logging functions needed by AdvancedConsoleLogger\n     */\n    static logInfo(prefix: string, info: any) {\n        console.log(chalk.gray.underline(prefix), info)\n    }\n\n    static logError(prefix: string, error: any) {\n        console.log(chalk.underline.red(prefix), error)\n    }\n\n    static logWarn(prefix: string, warning: any) {\n        console.log(chalk.underline.yellow(prefix), warning)\n    }\n\n    static log(message: string) {\n        console.log(chalk.underline(message))\n    }\n\n    static info(info: any) {\n        return chalk.gray(info)\n    }\n\n    static error(error: any) {\n        return chalk.red(error)\n    }\n\n    static warn(message: string) {\n        return chalk.yellow(message)\n    }\n\n    static logCmdErr(prefix: string, err?: any) {\n        console.log(chalk.black.bgRed(prefix))\n        if (err) console.error(err)\n    }\n}\n"],"sourceRoot":".."}