@skbkontur/cluster-config-client
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -5,3 +5,3 @@ // @flow | ||
export interface ISettingsProvider { | ||
getAllSettings(): Promise<Map<string, Array<string>>> | ||
getAllSettings(): Promise<{[string]: Array<string>}> | ||
} | ||
@@ -19,6 +19,6 @@ | ||
class BaseSettingsProvider /*:: implements ISettingsProvider */ { | ||
/*:: _settings: Settings */ | ||
/*:: __settings: Settings */ | ||
constructor(settings /* : $Shape<Settings> */ = {}) { | ||
this._settings = settings | ||
this.__settings = settings | ||
} | ||
@@ -25,0 +25,0 @@ |
@@ -42,4 +42,10 @@ // @flow | ||
async getSettingsByPrefix(prefix /* : string */) { | ||
if (!prefix) { | ||
throw new TypeError('You should specify prefix') | ||
} | ||
await this.waitForInitialization() | ||
return Trie.getFromTrie(prefix.split('/'), this._zone) | ||
const path = prefix.toLowerCase().split('/') | ||
return Trie.getFromTrie(path, this._zone) | ||
} | ||
@@ -46,0 +52,0 @@ |
@@ -7,5 +7,3 @@ // @flow | ||
_getAllSettingsInternal() { | ||
return new Promise((resolve, reject) => | ||
this._makeRequest(reject, resolve) | ||
) | ||
return new Promise((resolve, reject) => this._makeRequest(reject, resolve)) | ||
} | ||
@@ -15,3 +13,3 @@ | ||
let chunks = [] | ||
const { host, port, zone } = this._settings | ||
const { host, port, zone } = this.__settings | ||
const options = { | ||
@@ -18,0 +16,0 @@ hostname: host, |
{ | ||
"name": "@skbkontur/cluster-config-client", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Клиент к сервису конфигурации кластера контура", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
6970
157