From 8c7913f8967db35372b9930326449c5b9ebf4204 Mon Sep 17 00:00:00 2001 From: Chomp Date: Tue, 17 May 2022 10:07:16 +0100 Subject: [PATCH] Updates --- TypeScript/4UseACustomConfigFile/package.json | 2 +- TypeScript/4UseACustomConfigFile/src/mod.ts | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/TypeScript/4UseACustomConfigFile/package.json b/TypeScript/4UseACustomConfigFile/package.json index 87a132f..cfa0bd8 100644 --- a/TypeScript/4UseACustomConfigFile/package.json +++ b/TypeScript/4UseACustomConfigFile/package.json @@ -1,5 +1,5 @@ { - "name": "EditDatabase", + "name": "UseACustomConfigFile", "version": "1.0.0", "main": "src/mod.js", "license": "MIT", diff --git a/TypeScript/4UseACustomConfigFile/src/mod.ts b/TypeScript/4UseACustomConfigFile/src/mod.ts index d207e8d..1ea8830 100644 --- a/TypeScript/4UseACustomConfigFile/src/mod.ts +++ b/TypeScript/4UseACustomConfigFile/src/mod.ts @@ -2,21 +2,22 @@ import type { DependencyContainer } from "tsyringe"; import { IMod } from "../types/@types/external/mod"; import type { ILogger } from "../types/@types/spt/utils/ILogger"; -import * as modConfig from "../config/config.json"; class Mod implements IMod { + private modConfig = require("../config/config.json"); + // not used for this example public load(container: DependencyContainer): void { return } public delayedLoad(container: DependencyContainer): void - { + { // get logger const logger = container.resolve("WinstonLogger"); // log the 'myProperty' value to the console - logger.info(`here is the value from my config: ${modConfig.myProperty}`); + logger.info(`here is the value from my config: ${this.modConfig.myProperty}`); } }