have to stay commonjs for now
This commit is contained in:
parent
0f31e22f88
commit
767b431022
14
package-lock.json
generated
14
package-lock.json
generated
@ -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",
|
||||
|
@ -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",
|
||||
|
@ -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) {
|
||||
|
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user