import { PlatformTools } from "../../platform/PlatformTools";
/**
 * Reads connection options defined in the yml file.
 */
export class ConnectionOptionsYmlReader {
    // -------------------------------------------------------------------------
    // Public Methods
    // -------------------------------------------------------------------------
    /**
     * Reads connection options from given yml file.
     */
    read(path) {
        const ymlParser = PlatformTools.load("js-yaml");
        const config = ymlParser.safeLoad(PlatformTools.readFileSync(path));
        return Object.keys(config).map(connectionName => {
            return Object.assign({ name: connectionName }, config[connectionName]);
        });
    }
}

//# sourceMappingURL=ConnectionOptionsYmlReader.js.map
