UNPKG

nestjs-etcd

Version:
20 lines (19 loc) 871 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getConnectionName = exports.getClientToken = void 0; const etcd3_1 = require("etcd3"); const etcd_constants_1 = require("./etcd.constants"); function getClientToken(client = etcd_constants_1.DEFAULT_CLIENT_NAME) { return etcd_constants_1.DEFAULT_CLIENT_NAME === client ? etcd3_1.Etcd3 : typeof client === 'string' ? `${client}EtcdClient` : client instanceof etcd3_1.Etcd3 || etcd_constants_1.DEFAULT_CLIENT_NAME === client.name || !client.name ? etcd3_1.Etcd3 : `${client.name}EtcdClient`; } exports.getClientToken = getClientToken; function getConnectionName(options) { return options && options.name ? options.name : etcd_constants_1.DEFAULT_CLIENT_NAME; } exports.getConnectionName = getConnectionName;