nestjs-etcd3
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -1,6 +0,6 @@ | ||
import { Etcd3 } from "etcd3"; | ||
import { Etcd3, Namespace } from "etcd3"; | ||
export declare class EtcdService { | ||
private readonly client; | ||
constructor(client: Etcd3); | ||
getClient(): Etcd3; | ||
getClient(namespace?: string): Namespace; | ||
} |
@@ -22,4 +22,9 @@ "use strict"; | ||
} | ||
getClient() { | ||
return this.client; | ||
getClient(namespace) { | ||
if (namespace) { | ||
return this.client.namespace(namespace); | ||
} | ||
else { | ||
return this.client; | ||
} | ||
} | ||
@@ -26,0 +31,0 @@ }; |
import { Injectable, Inject } from "@nestjs/common"; | ||
import { ETCD_CLIENT } from './etcd.constants'; | ||
import { Etcd3 } from "etcd3"; | ||
import { Etcd3, Namespace } from "etcd3"; | ||
@@ -8,5 +8,9 @@ @Injectable() | ||
constructor(@Inject(ETCD_CLIENT) private readonly client: Etcd3) {} | ||
getClient(): Etcd3 { | ||
return this.client | ||
getClient(namespace? :string): Namespace { | ||
if (namespace) { | ||
return this.client.namespace(namespace) | ||
} else { | ||
return this.client | ||
} | ||
} | ||
} |
{ | ||
"name": "nestjs-etcd3", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "a nestjs etcd3 module", | ||
@@ -5,0 +5,0 @@ "author": "zzy", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16487
360