Compare commits

..

3 Commits

2 changed files with 0 additions and 29 deletions

12
dist/index.js vendored
View File

@ -64,17 +64,6 @@ class Config {
const settings = (0, deep_to_flat_object_1.default)(json);
for (const key of Object.keys(settings)) {
const value = settings[key];
let keyPath = key.split(".");
let isArray = key.includes(".") &&
keyPath.length > 1 &&
typeof parseInt(keyPath.pop()) === "number";
if (isArray) {
let itemPath = keyPath.join(".");
let item = this.get(itemPath, []);
item.push(value);
this.set(itemPath, item);
continue;
}
this.set(key, value);
}
}
@ -99,7 +88,6 @@ class Config {
}
key = this.normalize(key);
object_path_1.default.set(this.data, key, value);
this.data[key] = value;
}
has(key) {
(0, bsert_1.default)(typeof key === "string", "Key must be a string.");

View File

@ -75,21 +75,6 @@ export default class Config {
for (const key of Object.keys(settings)) {
const value = settings[key];
let keyPath = key.split(".");
let isArray =
key.includes(".") &&
keyPath.length > 1 &&
typeof parseInt(keyPath.pop()) === "number";
if (isArray) {
let itemPath = keyPath.join(".");
let item = this.get(itemPath, []);
item.push(value);
this.set(itemPath, item);
continue;
}
this.set(key, value);
}
}
@ -123,8 +108,6 @@ export default class Config {
key = this.normalize(key);
objectPath.set(this.data, key, value);
this.data[key] = value;
}
public has(key: string) {