{"version":3,"sources":["../../src/connection/options-reader/ConnectionOptionsYmlReader.ts"],"names":[],"mappings":";;AAAA,8DAA2D;AAG3D;;GAEG;AACH;IAAA;IAiBA,CAAC;IAfG,4EAA4E;IAC5E,iBAAiB;IACjB,4EAA4E;IAE5E;;OAEG;IACH,yCAAI,GAAJ,UAAK,IAAY;QACb,IAAM,SAAS,GAAG,6BAAa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAChD,IAAM,MAAM,GAAG,SAAS,CAAC,QAAQ,CAAC,6BAAa,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;AAjBY,gEAA0B","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":"../.."}
|