From e1c57ea40b5f477abfd4749bc36744f0154335a7 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 18 Apr 2023 23:36:10 -0400 Subject: [PATCH] *Make the config property meta --- src/index.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/index.ts b/src/index.ts index eec9b2e..547de93 100644 --- a/src/index.ts +++ b/src/index.ts @@ -20,12 +20,14 @@ import deepToFlatObject from "deep-to-flat-object"; export default class Config { private module: string; private data = {}; + private configProperty; - constructor(module: string) { + constructor(module: string, configProperty: string) { assert(typeof module === "string"); assert(module.length > 0); this.module = module; + this.configProperty = configProperty; } public inject(options: object) { @@ -83,7 +85,7 @@ export default class Config { assert(typeof data === "object"); assert(!Array.isArray(data)); - const configDir = this.str("configdir"); + const configDir = this.str(this.configProperty); const fullPath = Path.join(configDir, `${file}.json`); if (!fs.existsSync(configDir)) {