diff --git a/package-lock.json b/package-lock.json index e014496..3e0049c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,6 @@ "version": "3.6.0", "license": "MIT", "dependencies": { - "dateformat": "^5.0.3", "fs-extra": "^11.1.1", "reflect-metadata": "^0.1.13", "semver": "^7.5.4", @@ -587,14 +586,6 @@ "node": ">= 8" } }, - "node_modules/dateformat": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-5.0.3.tgz", - "integrity": "sha512-Kvr6HmPXUMerlLcLF+Pwq3K7apHpYmGDVqrxcDasBg86UcKeTSNWbEzU8bwdXnxnR44FtMhJAxI4Bov6Y/KUfA==", - "engines": { - "node": ">=12.20" - } - }, "node_modules/debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", @@ -2117,11 +2108,6 @@ "which": "^2.0.1" } }, - "dateformat": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-5.0.3.tgz", - "integrity": "sha512-Kvr6HmPXUMerlLcLF+Pwq3K7apHpYmGDVqrxcDasBg86UcKeTSNWbEzU8bwdXnxnR44FtMhJAxI4Bov6Y/KUfA==" - }, "debug": { "version": "4.3.4", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", diff --git a/package.json b/package.json index 120be5e..8381d6d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@squeebot/core", - "version": "3.6.0", + "version": "3.6.0-1", "description": "Squeebot v3 core for the execution environment", "main": "lib/index.js", "types": "lib/index.d.ts", @@ -28,7 +28,6 @@ "typescript": "^5.1.6" }, "dependencies": { - "dateformat": "^5.0.3", "fs-extra": "^11.1.1", "reflect-metadata": "^0.1.13", "semver": "^7.5.4", diff --git a/src/core/logger.ts b/src/core/logger.ts index f5d4b4f..b095443 100644 --- a/src/core/logger.ts +++ b/src/core/logger.ts @@ -1,4 +1,3 @@ -import dateFmt from 'dateformat'; import util from 'util'; type LogType = 'info' | 'debug' | 'warn' | 'error'; @@ -13,6 +12,12 @@ export class Logger { public timestamp = 'dd/mm/yy HH:MM:ss' ) {} + public dateFmt(date: Date) { + return date.toISOString() + .replace(/T/, ' ') + .replace(/\..+/, ''); + } + /** * Set node.js readline consideration * @param rl Readline instance @@ -38,7 +43,7 @@ export class Logger { let cfunc = this.console[0]; if (this.timestamp) { - message.push(`[${dateFmt(new Date(), this.timestamp)}]`); + message.push(`[${this.dateFmt(new Date())}]`); } switch (ltype) { diff --git a/tsconfig.json b/tsconfig.json index 309ae67..90d2036 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -23,6 +23,8 @@ "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + "moduleResolution": "Node", + /* Strict Type-Checking Options */ "strict": true, /* Enable all strict type-checking options. */ // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */