333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
{"version":3,"sources":["../browser/src/connection/options-reader/ConnectionOptionsYmlReader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,8BAA8B,CAAC;AAG3D;;GAEG;AACH;IAAA;IAiBA,CAAC;IAfG,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACH,yCAAI,GAAJ,UAAK,IAAY;QACb,IAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChD,IAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QACpE,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,UAAA,cAAc;YACzC,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;QAC3E,CAAC,CAAC,CAAC;IACP,CAAC;IAEL,iCAAC;AAAD,CAjBA,AAiBC,IAAA","file":"ConnectionOptionsYmlReader.js","sourcesContent":["import {PlatformTools} from \"../../platform/PlatformTools\";\nimport {ConnectionOptions} from \"../ConnectionOptions\";\n\n/**\n * Reads connection options defined in the yml file.\n */\nexport class ConnectionOptionsYmlReader {\n\n    // -------------------------------------------------------------------------\n    // Public Methods\n    // -------------------------------------------------------------------------\n\n    /**\n     * Reads connection options from given yml file.\n     */\n    read(path: string): ConnectionOptions[] {\n        const ymlParser = PlatformTools.load(\"js-yaml\");\n        const config = ymlParser.safeLoad(PlatformTools.readFileSync(path));\n        return Object.keys(config).map(connectionName => {\n            return Object.assign({ name: connectionName }, config[connectionName]);\n        });\n    }\n\n}"],"sourceRoot":"../.."}