diff --git a/demo/express.js b/demo/express.js index d6e7ac6..38c2d65 100644 --- a/demo/express.js +++ b/demo/express.js @@ -12,4 +12,4 @@ app.get('/', (req, res) => { app.listen(8080, () => { console.info('Listening on port 8080...'); -}); \ No newline at end of file +}); diff --git a/demo/express.ts b/demo/express.ts index ed070e4..d13cad6 100644 --- a/demo/express.ts +++ b/demo/express.ts @@ -12,4 +12,4 @@ app.get('/', (req, res) => { app.listen(8080, () => { console.info('Listening on port 8080...'); -}); \ No newline at end of file +}); diff --git a/demo/javascript.js b/demo/javascript.js index 85aa9d0..096359e 100644 --- a/demo/javascript.js +++ b/demo/javascript.js @@ -11,4 +11,4 @@ console.info('this is a info message'); console.error('this is a error message'); console.warn('this is a warn message'); console.debug('this is a debug message'); -console.line('this is a line message'); \ No newline at end of file +console.line('this is a line message'); diff --git a/demo/noColor.js b/demo/noColor.js new file mode 100644 index 0000000..afd227f --- /dev/null +++ b/demo/noColor.js @@ -0,0 +1,14 @@ +const betterLogging = require('..'); +const { Theme } = betterLogging; +betterLogging(console, { + color: Theme.noColor +}); + +console.logLevel = 4; + +console.log('this is a log message'); +console.info('this is a info message'); +console.error('this is a error message'); +console.warn('this is a warn message'); +console.debug('this is a debug message'); +console.line('this is a line message'); diff --git a/demo/noColor.ts b/demo/noColor.ts new file mode 100644 index 0000000..4deb77d --- /dev/null +++ b/demo/noColor.ts @@ -0,0 +1,13 @@ +import betterLogging, { Theme } from '..'; +betterLogging(console, { + color: Theme.noColor, +}); + +console.logLevel = 4; + +console.log('this is a log message'); +console.info('this is a info message'); +console.error('this is a error message'); +console.warn('this is a warn message'); +console.debug('this is a debug message'); +console.line('this is a line message'); diff --git a/demo/saveToFile.js b/demo/saveToFile.js index c077724..25161a5 100644 --- a/demo/saveToFile.js +++ b/demo/saveToFile.js @@ -11,4 +11,4 @@ console.info('this is a info message'); console.error('this is a error message'); console.warn('this is a warn message'); console.debug('this is a debug message'); -console.line('this is a line message'); \ No newline at end of file +console.line('this is a line message'); diff --git a/demo/saveToFile.ts b/demo/saveToFile.ts index a8817d2..8974022 100644 --- a/demo/saveToFile.ts +++ b/demo/saveToFile.ts @@ -12,4 +12,4 @@ console.info('this is a info message'); console.error('this is a error message'); console.warn('this is a warn message'); console.debug('this is a debug message'); -console.line('this is a line message'); \ No newline at end of file +console.line('this is a line message'); diff --git a/demo/typescript.ts b/demo/typescript.ts index a933581..f2796d2 100644 --- a/demo/typescript.ts +++ b/demo/typescript.ts @@ -10,4 +10,4 @@ console.info('this is a info message'); console.error('this is a error message'); console.warn('this is a warn message'); console.debug('this is a debug message'); -console.line('this is a line message'); \ No newline at end of file +console.line('this is a line message'); diff --git a/package-lock.json b/package-lock.json index 1829e25..c6c9be9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,31 +1,31 @@ { "name": "better-logging", - "version": "4.5.1", + "version": "4.6.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "better-logging", - "version": "4.5.1", + "version": "4.6.0", "license": "MIT", "dependencies": { - "@olian/typescript-helpers": "^2.3.0", - "@types/node": "^16.11.7", + "@olian/typescript-helpers": "^2.4.1", + "@types/node": "^17.0.19", "chalk": "^4.1.2", "fast-safe-stringify": "^2.1.1" }, "devDependencies": { - "@types/chai": "^4.2.22", + "@types/chai": "^4.3.0", "@types/express": "^4.17.13", - "@types/mocha": "^9.0.0", + "@types/mocha": "^9.1.0", "@types/typescript": "^2.0.0", - "chai": "^4.3.4", - "express": "^4.17.1", - "memfs": "^3.3.0", - "mocha": "^9.1.3", - "ts-node": "^10.4.0", + "chai": "^4.3.6", + "express": "^4.17.3", + "memfs": "^3.4.1", + "mocha": "^9.2.1", + "ts-node": "^10.5.0", "tslint": "^6.1.3", - "typescript": "^4.4.4" + "typescript": "^4.5.5" }, "engines": { "node": ">=12" @@ -159,9 +159,9 @@ } }, "node_modules/@olian/typescript-helpers": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@olian/typescript-helpers/-/typescript-helpers-2.3.0.tgz", - "integrity": "sha512-dM8+K04V3ZhRt/FadIIidXT3MykFjSetmZzV940nYY6iCUeGF2LSxJNwK3JQD06N9F1JjDPLXtIIYxffEJEcHw==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@olian/typescript-helpers/-/typescript-helpers-2.4.1.tgz", + "integrity": "sha512-eUK1OpKVo1FXodFCrQGiDkdTDbnXVH8KH/hS/HT3sarAUGSi2g16oGzr3FGS5/2j+PB1RAkxzMLZC90vUxQ06Q==" }, "node_modules/@tsconfig/node10": { "version": "1.0.8", @@ -198,9 +198,9 @@ } }, "node_modules/@types/chai": { - "version": "4.2.22", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz", - "integrity": "sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", + "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", "dev": true }, "node_modules/@types/connect": { @@ -242,15 +242,15 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", - "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", + "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", "dev": true }, "node_modules/@types/node": { - "version": "16.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", - "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==" + "version": "17.0.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.19.tgz", + "integrity": "sha512-PfeQhvcMR4cPFVuYfBN4ifG7p9c+Dlh3yUZR6k+5yQK7wX3gDgVxBly4/WkBRs9x4dmcy1TVl08SY67wwtEvmA==" }, "node_modules/@types/qs": { "version": "6.9.7", @@ -291,13 +291,13 @@ "dev": true }, "node_modules/accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, "dependencies": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" }, "engines": { "node": ">= 0.6" @@ -403,21 +403,21 @@ } }, "node_modules/body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", "dev": true, "dependencies": { - "bytes": "3.1.0", + "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", "depd": "~1.1.2", - "http-errors": "1.7.2", + "http-errors": "1.8.1", "iconv-lite": "0.4.24", "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" + "qs": "6.9.7", + "raw-body": "2.4.3", + "type-is": "~1.6.18" }, "engines": { "node": ">= 0.8" @@ -461,9 +461,9 @@ } }, "node_modules/bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true, "engines": { "node": ">= 0.8" @@ -482,15 +482,16 @@ } }, "node_modules/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", "dev": true, "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", "deep-eql": "^3.0.1", "get-func-name": "^2.0.0", + "loupe": "^2.3.1", "pathval": "^1.1.1", "type-detect": "^4.0.5" }, @@ -523,10 +524,16 @@ } }, "node_modules/chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", - "dev": true, + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], "dependencies": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -627,12 +634,12 @@ "dev": true }, "node_modules/content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "dev": true, "dependencies": { - "safe-buffer": "5.1.2" + "safe-buffer": "5.2.1" }, "engines": { "node": ">= 0.6" @@ -648,9 +655,9 @@ } }, "node_modules/cookie": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true, "engines": { "node": ">= 0.6" @@ -796,17 +803,17 @@ } }, "node_modules/express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "version": "4.17.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", + "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", "dev": true, "dependencies": { - "accepts": "~1.3.7", + "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", + "body-parser": "1.19.2", + "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.4.0", + "cookie": "0.4.2", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", @@ -820,13 +827,13 @@ "on-finished": "~2.3.0", "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", + "proxy-addr": "~2.0.7", + "qs": "6.9.7", "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", + "safe-buffer": "5.2.1", + "send": "0.17.2", + "serve-static": "1.14.2", + "setprototypeof": "1.2.0", "statuses": "~1.5.0", "type-is": "~1.6.18", "utils-merge": "1.0.1", @@ -965,9 +972,9 @@ } }, "node_modules/glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "dependencies": { "fs.realpath": "^1.0.0", @@ -1035,16 +1042,16 @@ } }, "node_modules/http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", "dev": true, "dependencies": { "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" + "toidentifier": "1.0.1" }, "engines": { "node": ">= 0.6" @@ -1073,9 +1080,9 @@ } }, "node_modules/inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "node_modules/ipaddr.js": { @@ -1217,6 +1224,15 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "dependencies": { + "get-func-name": "^2.0.0" + } + }, "node_modules/make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -1233,9 +1249,9 @@ } }, "node_modules/memfs": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.3.0.tgz", - "integrity": "sha512-BEE62uMfKOavX3iG7GYX43QJ+hAeeWnwIAuJ/R6q96jaMtiLzhsxHJC8B1L7fK7Pt/vXDRwb3SG/yBpNGDPqzg==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.1.tgz", + "integrity": "sha512-1c9VPVvW5P7I85c35zAdEr1TD5+F11IToIHIlrVIcflfnzPkJa0ZoYEoEdYDP8KgPFoSZ/opDrUsAoZWym3mtw==", "dev": true, "dependencies": { "fs-monkey": "1.0.3" @@ -1323,32 +1339,32 @@ } }, "node_modules/mocha": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", - "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz", + "integrity": "sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==", "dev": true, "dependencies": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.2", - "debug": "4.3.2", + "chokidar": "3.5.3", + "debug": "4.3.3", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.7", + "glob": "7.2.0", "growl": "1.10.5", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "3.0.4", "ms": "2.1.3", - "nanoid": "3.1.25", + "nanoid": "3.2.0", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "which": "2.0.2", - "workerpool": "6.1.5", + "workerpool": "6.2.0", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" @@ -1366,9 +1382,9 @@ } }, "node_modules/mocha/node_modules/debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "dependencies": { "ms": "2.1.2" @@ -1416,9 +1432,9 @@ "dev": true }, "node_modules/nanoid": { - "version": "3.1.25", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", - "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", + "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", "dev": true, "bin": { "nanoid": "bin/nanoid.cjs" @@ -1428,9 +1444,9 @@ } }, "node_modules/negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true, "engines": { "node": ">= 0.6" @@ -1545,9 +1561,9 @@ } }, "node_modules/picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true, "engines": { "node": ">=8.6" @@ -1570,12 +1586,15 @@ } }, "node_modules/qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", "dev": true, "engines": { "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, "node_modules/randombytes": { @@ -1597,13 +1616,13 @@ } }, "node_modules/raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", + "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", "dev": true, "dependencies": { - "bytes": "3.1.0", - "http-errors": "1.7.2", + "bytes": "3.1.2", + "http-errors": "1.8.1", "iconv-lite": "0.4.24", "unpipe": "1.0.0" }, @@ -1646,10 +1665,24 @@ } }, "node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, "node_modules/safer-buffer": { "version": "2.1.2", @@ -1667,9 +1700,9 @@ } }, "node_modules/send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", + "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", "dev": true, "dependencies": { "debug": "2.6.9", @@ -1679,9 +1712,9 @@ "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "~1.7.2", + "http-errors": "1.8.1", "mime": "1.6.0", - "ms": "2.1.1", + "ms": "2.1.3", "on-finished": "~2.3.0", "range-parser": "~1.2.1", "statuses": "~1.5.0" @@ -1691,9 +1724,9 @@ } }, "node_modules/send/node_modules/ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true }, "node_modules/serialize-javascript": { @@ -1706,24 +1739,24 @@ } }, "node_modules/serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", + "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", "dev": true, "dependencies": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.17.1" + "send": "0.17.2" }, "engines": { "node": ">= 0.8.0" } }, "node_modules/setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, "node_modules/sprintf-js": { @@ -1777,18 +1810,18 @@ } }, "node_modules/toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true, "engines": { "node": ">=0.6" } }, "node_modules/ts-node": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", - "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.5.0.tgz", + "integrity": "sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw==", "dev": true, "dependencies": { "@cspotcode/source-map-support": "0.7.0", @@ -1802,6 +1835,7 @@ "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.0", "yn": "3.1.1" }, "bin": { @@ -2009,9 +2043,9 @@ } }, "node_modules/typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true, "bin": { "tsc": "bin/tsc", @@ -2039,6 +2073,12 @@ "node": ">= 0.4.0" } }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz", + "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", + "dev": true + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -2064,9 +2104,9 @@ } }, "node_modules/workerpool": { - "version": "6.1.5", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", - "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", "dev": true }, "node_modules/wrap-ansi": { @@ -2354,9 +2394,9 @@ } }, "@olian/typescript-helpers": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@olian/typescript-helpers/-/typescript-helpers-2.3.0.tgz", - "integrity": "sha512-dM8+K04V3ZhRt/FadIIidXT3MykFjSetmZzV940nYY6iCUeGF2LSxJNwK3JQD06N9F1JjDPLXtIIYxffEJEcHw==" + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/@olian/typescript-helpers/-/typescript-helpers-2.4.1.tgz", + "integrity": "sha512-eUK1OpKVo1FXodFCrQGiDkdTDbnXVH8KH/hS/HT3sarAUGSi2g16oGzr3FGS5/2j+PB1RAkxzMLZC90vUxQ06Q==" }, "@tsconfig/node10": { "version": "1.0.8", @@ -2393,9 +2433,9 @@ } }, "@types/chai": { - "version": "4.2.22", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz", - "integrity": "sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", + "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", "dev": true }, "@types/connect": { @@ -2437,15 +2477,15 @@ "dev": true }, "@types/mocha": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.0.0.tgz", - "integrity": "sha512-scN0hAWyLVAvLR9AyW7HoFF5sJZglyBsbPuHO4fv7JRvfmPBMfp1ozWqOf/e4wwPNxezBZXRfWzMb6iFLgEVRA==", + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.0.tgz", + "integrity": "sha512-QCWHkbMv4Y5U9oW10Uxbr45qMMSzl4OzijsozynUAgx3kEHUdXB00udx2dWDQ7f2TU2a2uuiFaRZjCe3unPpeg==", "dev": true }, "@types/node": { - "version": "16.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", - "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==" + "version": "17.0.19", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.19.tgz", + "integrity": "sha512-PfeQhvcMR4cPFVuYfBN4ifG7p9c+Dlh3yUZR6k+5yQK7wX3gDgVxBly4/WkBRs9x4dmcy1TVl08SY67wwtEvmA==" }, "@types/qs": { "version": "6.9.7", @@ -2485,13 +2525,13 @@ "dev": true }, "accepts": { - "version": "1.3.7", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", "dev": true, "requires": { - "mime-types": "~2.1.24", - "negotiator": "0.6.2" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" } }, "acorn": { @@ -2567,21 +2607,21 @@ "dev": true }, "body-parser": { - "version": "1.19.0", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", "dev": true, "requires": { - "bytes": "3.1.0", + "bytes": "3.1.2", "content-type": "~1.0.4", "debug": "2.6.9", "depd": "~1.1.2", - "http-errors": "1.7.2", + "http-errors": "1.8.1", "iconv-lite": "0.4.24", "on-finished": "~2.3.0", - "qs": "6.7.0", - "raw-body": "2.4.0", - "type-is": "~1.6.17" + "qs": "6.9.7", + "raw-body": "2.4.3", + "type-is": "~1.6.18" } }, "brace-expansion": { @@ -2616,9 +2656,9 @@ "dev": true }, "bytes": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", "dev": true }, "camelcase": { @@ -2628,15 +2668,16 @@ "dev": true }, "chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.6.tgz", + "integrity": "sha512-bbcp3YfHCUzMOvKqsztczerVgBKSsEijCySNlHHbX3VG1nskvqjz5Rfso1gGwD6w6oOV3eI60pKuMOV5MV7p3Q==", "dev": true, "requires": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", "deep-eql": "^3.0.1", "get-func-name": "^2.0.0", + "loupe": "^2.3.1", "pathval": "^1.1.1", "type-detect": "^4.0.5" } @@ -2657,9 +2698,9 @@ "dev": true }, "chokidar": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", - "integrity": "sha512-ekGhOnNVPgT77r4K/U3GDhu+FQ2S8TnK/s2KbIGXi0SZWuwkZ2QNyfWdZW+TVfn84DpEP7rLeCt2UI6bJ8GwbQ==", + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", + "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", "dev": true, "requires": { "anymatch": "~3.1.2", @@ -2743,12 +2784,12 @@ "dev": true }, "content-disposition": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.3.tgz", - "integrity": "sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g==", + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "5.2.1" } }, "content-type": { @@ -2758,9 +2799,9 @@ "dev": true }, "cookie": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz", - "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg==", + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", "dev": true }, "cookie-signature": { @@ -2866,17 +2907,17 @@ "dev": true }, "express": { - "version": "4.17.1", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.1.tgz", - "integrity": "sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g==", + "version": "4.17.3", + "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", + "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", "dev": true, "requires": { - "accepts": "~1.3.7", + "accepts": "~1.3.8", "array-flatten": "1.1.1", - "body-parser": "1.19.0", - "content-disposition": "0.5.3", + "body-parser": "1.19.2", + "content-disposition": "0.5.4", "content-type": "~1.0.4", - "cookie": "0.4.0", + "cookie": "0.4.2", "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", @@ -2890,13 +2931,13 @@ "on-finished": "~2.3.0", "parseurl": "~1.3.3", "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.5", - "qs": "6.7.0", + "proxy-addr": "~2.0.7", + "qs": "6.9.7", "range-parser": "~1.2.1", - "safe-buffer": "5.1.2", - "send": "0.17.1", - "serve-static": "1.14.1", - "setprototypeof": "1.1.1", + "safe-buffer": "5.2.1", + "send": "0.17.2", + "serve-static": "1.14.2", + "setprototypeof": "1.2.0", "statuses": "~1.5.0", "type-is": "~1.6.18", "utils-merge": "1.0.1", @@ -2998,9 +3039,9 @@ "dev": true }, "glob": { - "version": "7.1.7", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", - "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -3047,16 +3088,16 @@ "dev": true }, "http-errors": { - "version": "1.7.2", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", + "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", "dev": true, "requires": { "depd": "~1.1.2", - "inherits": "2.0.3", - "setprototypeof": "1.1.1", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.0" + "toidentifier": "1.0.1" } }, "iconv-lite": { @@ -3079,9 +3120,9 @@ } }, "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "ipaddr.js": { @@ -3181,6 +3222,15 @@ "is-unicode-supported": "^0.1.0" } }, + "loupe": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.4.tgz", + "integrity": "sha512-OvKfgCC2Ndby6aSTREl5aCCPTNIzlDfQZvZxNUrBrihDhL3xcrYegTblhmEiCrg2kKQz4XsFIaemE5BF4ybSaQ==", + "dev": true, + "requires": { + "get-func-name": "^2.0.0" + } + }, "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", @@ -3194,9 +3244,9 @@ "dev": true }, "memfs": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.3.0.tgz", - "integrity": "sha512-BEE62uMfKOavX3iG7GYX43QJ+hAeeWnwIAuJ/R6q96jaMtiLzhsxHJC8B1L7fK7Pt/vXDRwb3SG/yBpNGDPqzg==", + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/memfs/-/memfs-3.4.1.tgz", + "integrity": "sha512-1c9VPVvW5P7I85c35zAdEr1TD5+F11IToIHIlrVIcflfnzPkJa0ZoYEoEdYDP8KgPFoSZ/opDrUsAoZWym3mtw==", "dev": true, "requires": { "fs-monkey": "1.0.3" @@ -3260,41 +3310,41 @@ } }, "mocha": { - "version": "9.1.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.1.3.tgz", - "integrity": "sha512-Xcpl9FqXOAYqI3j79pEtHBBnQgVXIhpULjGQa7DVb0Po+VzmSIK9kanAiWLHoRR/dbZ2qpdPshuXr8l1VaHCzw==", + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-9.2.1.tgz", + "integrity": "sha512-T7uscqjJVS46Pq1XDXyo9Uvey9gd3huT/DD9cYBb4K2Xc/vbKRPUWK067bxDQRK0yIz6Jxk73IrnimvASzBNAQ==", "dev": true, "requires": { "@ungap/promise-all-settled": "1.1.2", "ansi-colors": "4.1.1", "browser-stdout": "1.3.1", - "chokidar": "3.5.2", - "debug": "4.3.2", + "chokidar": "3.5.3", + "debug": "4.3.3", "diff": "5.0.0", "escape-string-regexp": "4.0.0", "find-up": "5.0.0", - "glob": "7.1.7", + "glob": "7.2.0", "growl": "1.10.5", "he": "1.2.0", "js-yaml": "4.1.0", "log-symbols": "4.1.0", "minimatch": "3.0.4", "ms": "2.1.3", - "nanoid": "3.1.25", + "nanoid": "3.2.0", "serialize-javascript": "6.0.0", "strip-json-comments": "3.1.1", "supports-color": "8.1.1", "which": "2.0.2", - "workerpool": "6.1.5", + "workerpool": "6.2.0", "yargs": "16.2.0", "yargs-parser": "20.2.4", "yargs-unparser": "2.0.0" }, "dependencies": { "debug": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", - "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", "dev": true, "requires": { "ms": "2.1.2" @@ -3332,15 +3382,15 @@ "dev": true }, "nanoid": { - "version": "3.1.25", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", - "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.2.0.tgz", + "integrity": "sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA==", "dev": true }, "negotiator": { - "version": "0.6.2", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", "dev": true }, "normalize-path": { @@ -3422,9 +3472,9 @@ "dev": true }, "picomatch": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.0.tgz", - "integrity": "sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "dev": true }, "proxy-addr": { @@ -3438,9 +3488,9 @@ } }, "qs": { - "version": "6.7.0", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", + "version": "6.9.7", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", + "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", "dev": true }, "randombytes": { @@ -3459,13 +3509,13 @@ "dev": true }, "raw-body": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", + "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", "dev": true, "requires": { - "bytes": "3.1.0", - "http-errors": "1.7.2", + "bytes": "3.1.2", + "http-errors": "1.8.1", "iconv-lite": "0.4.24", "unpipe": "1.0.0" } @@ -3496,9 +3546,9 @@ } }, "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", "dev": true }, "safer-buffer": { @@ -3514,9 +3564,9 @@ "dev": true }, "send": { - "version": "0.17.1", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.1.tgz", - "integrity": "sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg==", + "version": "0.17.2", + "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", + "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", "dev": true, "requires": { "debug": "2.6.9", @@ -3526,18 +3576,18 @@ "escape-html": "~1.0.3", "etag": "~1.8.1", "fresh": "0.5.2", - "http-errors": "~1.7.2", + "http-errors": "1.8.1", "mime": "1.6.0", - "ms": "2.1.1", + "ms": "2.1.3", "on-finished": "~2.3.0", "range-parser": "~1.2.1", "statuses": "~1.5.0" }, "dependencies": { "ms": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", "dev": true } } @@ -3552,21 +3602,21 @@ } }, "serve-static": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.1.tgz", - "integrity": "sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg==", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", + "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", "dev": true, "requires": { "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "parseurl": "~1.3.3", - "send": "0.17.1" + "send": "0.17.2" } }, "setprototypeof": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "dev": true }, "sprintf-js": { @@ -3605,15 +3655,15 @@ } }, "toidentifier": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", "dev": true }, "ts-node": { - "version": "10.4.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.4.0.tgz", - "integrity": "sha512-g0FlPvvCXSIO1JDF6S232P5jPYqBkRL9qly81ZgAOSU7rwI0stphCgd2kLiCrU9DjQCrJMWEqcNSjQL02s6d8A==", + "version": "10.5.0", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.5.0.tgz", + "integrity": "sha512-6kEJKwVxAJ35W4akuiysfKwKmjkbYxwQMTBaAxo9KKAx/Yd26mPUyhGz3ji+EsJoAgrLqVsYHNuuYwQe22lbtw==", "dev": true, "requires": { "@cspotcode/source-map-support": "0.7.0", @@ -3627,6 +3677,7 @@ "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.0", "yn": "3.1.1" }, "dependencies": { @@ -3774,9 +3825,9 @@ } }, "typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true }, "unpipe": { @@ -3791,6 +3842,12 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", "dev": true }, + "v8-compile-cache-lib": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.0.tgz", + "integrity": "sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==", + "dev": true + }, "vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -3807,9 +3864,9 @@ } }, "workerpool": { - "version": "6.1.5", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.1.5.tgz", - "integrity": "sha512-XdKkCK0Zqc6w3iTxLckiuJ81tiD/o5rBE/m+nXpRCB+/Sq4DqkfXZ/x0jW02DG1tGsfUGXbTJyZDP+eu67haSw==", + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.0.tgz", + "integrity": "sha512-Rsk5qQHJ9eowMH28Jwhe8HEbmdYDX4lwoMWshiCXugjtHqMD9ZbiqSDLxcsfdqsETPzVUtX5s1Z5kStiIM6l4A==", "dev": true }, "wrap-ansi": { diff --git a/package.json b/package.json index 048144a..5871d8d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "better-logging", - "version": "4.6.0", + "version": "4.7.0", "description": "better-logging is a drop in replacement for the default logging methods of node.js", "main": "./index.js", "typings": "./dist/api.d.ts", @@ -8,6 +8,8 @@ "scripts": { "demo:ts": "ts-node demo/typescript.ts", "demo:js": "node demo/javascript.js", + "demo:nocolor:ts": "ts-node demo/noColor.ts", + "demo:nocolor:js": "node demo/noColor.js", "demo:express:ts": "ts-node demo/express.ts", "demo:express:js": "node demo/express.js", "demo:save:ts": "ts-node demo/saveToFile.ts", @@ -44,22 +46,22 @@ }, "homepage": "https://github.com/Olian04/better-logging#readme", "dependencies": { - "@olian/typescript-helpers": "^2.3.0", - "@types/node": "^16.11.7", + "@olian/typescript-helpers": "^2.4.1", + "@types/node": "^17.0.19", "chalk": "^4.1.2", "fast-safe-stringify": "^2.1.1" }, "devDependencies": { - "@types/chai": "^4.2.22", + "@types/chai": "^4.3.0", "@types/express": "^4.17.13", - "@types/mocha": "^9.0.0", + "@types/mocha": "^9.1.0", "@types/typescript": "^2.0.0", - "chai": "^4.3.4", - "express": "^4.17.1", - "memfs": "^3.3.0", - "mocha": "^9.1.3", - "ts-node": "^10.4.0", + "chai": "^4.3.6", + "express": "^4.17.3", + "memfs": "^3.4.1", + "mocha": "^9.2.1", + "ts-node": "^10.5.0", "tslint": "^6.1.3", - "typescript": "^4.4.4" + "typescript": "^4.5.5" } } diff --git a/src/lib/decorateObject.ts b/src/lib/decorateObject.ts index c3d21a0..a354d2f 100644 --- a/src/lib/decorateObject.ts +++ b/src/lib/decorateObject.ts @@ -47,4 +47,4 @@ export const decorateObject = (target: T, implementation: LogF }; return targetObject; -} \ No newline at end of file +} diff --git a/src/lib/interfaces/decoratedInstance.ts b/src/lib/interfaces/decoratedInstance.ts index 497f490..fd37995 100644 --- a/src/lib/interfaces/decoratedInstance.ts +++ b/src/lib/interfaces/decoratedInstance.ts @@ -4,4 +4,4 @@ import { LogFunction } from '../types/logFunction'; export interface DecoratedInstance extends LogFunctionMap { line: LogFunction; logLevel: number; -} \ No newline at end of file +} diff --git a/src/lib/interfaces/formatting.context.ts b/src/lib/interfaces/formatting.context.ts index fe1338d..5132b74 100644 --- a/src/lib/interfaces/formatting.context.ts +++ b/src/lib/interfaces/formatting.context.ts @@ -8,4 +8,4 @@ export interface FormattingContext { date: string; unix: string; STAMP: (content: string | number, color?: Color) => string; -} \ No newline at end of file +} diff --git a/src/lib/interfaces/logFunctionMap.ts b/src/lib/interfaces/logFunctionMap.ts index 808f937..f36aa77 100644 --- a/src/lib/interfaces/logFunctionMap.ts +++ b/src/lib/interfaces/logFunctionMap.ts @@ -6,4 +6,4 @@ export interface LogFunctionMap { info: LogFunction; warn: LogFunction; error: LogFunction; -} \ No newline at end of file +} diff --git a/src/lib/interfaces/theme.ts b/src/lib/interfaces/theme.ts index 7f9f78e..464241d 100644 --- a/src/lib/interfaces/theme.ts +++ b/src/lib/interfaces/theme.ts @@ -9,4 +9,4 @@ export interface Theme { readonly error: Color, readonly warn: Color, } -} \ No newline at end of file +} diff --git a/src/themes/green.ts b/src/themes/green.ts index 9822cb5..4c38940 100644 --- a/src/themes/green.ts +++ b/src/themes/green.ts @@ -10,4 +10,4 @@ export const theme: Theme = { error: chalk.redBright, debug: chalk.cyan, } -} \ No newline at end of file +} diff --git a/src/themes/index.ts b/src/themes/index.ts index 4f9cf05..05b58a9 100644 --- a/src/themes/index.ts +++ b/src/themes/index.ts @@ -1,3 +1,4 @@ export { theme as dark } from './dark'; export { theme as light } from './light'; export { theme as green } from './green'; +export { theme as noColor } from './noColor'; diff --git a/src/themes/light.ts b/src/themes/light.ts index b824b03..ddcbc5a 100644 --- a/src/themes/light.ts +++ b/src/themes/light.ts @@ -10,4 +10,4 @@ export const theme: Theme = { error: chalk.redBright, debug: chalk.cyan, } -} \ No newline at end of file +} diff --git a/src/themes/noColor.ts b/src/themes/noColor.ts new file mode 100644 index 0000000..2f8abd3 --- /dev/null +++ b/src/themes/noColor.ts @@ -0,0 +1,15 @@ +import chalk from 'chalk'; +import { Theme } from '../lib/interfaces/theme'; + +const identity = chalk; + +export const theme: Theme = { + base: identity, + type: { + log: identity, + info: identity, + warn: identity, + error: identity, + debug: identity, + } +}; diff --git a/test/integration-tests/custom-formatting.test.js b/test/integration-tests/custom-formatting.test.js index c72cc62..186fbca 100644 --- a/test/integration-tests/custom-formatting.test.js +++ b/test/integration-tests/custom-formatting.test.js @@ -1,12 +1,11 @@ //@ts-check const { expect } = require('chai'); -const { CustomInstance } = require('../../dist/api'); -const { removeColors } = require('../../dist/lib/util/removeColor'); +const { CustomInstance, Theme } = require('../../dist/api'); describe('Custom-Formatting', () => { const lastMsgOfType = {} const catchLog = type => msg => { - lastMsgOfType[type] = removeColors(msg); + lastMsgOfType[type] = msg; } const pretendLogger = CustomInstance({ log: catchLog('log'), @@ -18,12 +17,13 @@ describe('Custom-Formatting', () => { const better = {}; if (!pretendLogger(better, { - format: ctx => `${ctx.type} ${ctx.STAMP('lel')} ${ctx.msg}` + format: ctx => `${ctx.type} ${ctx.STAMP('lel')} ${ctx.msg}`, + color: Theme.noColor, })) throw 'This will never happen'; better.logLevel = 5; it('#line()', () => { - better.line('foo'); + better.line('foo'); expect(lastMsgOfType['log']).to.equal('foo'); }); ['log', 'info', 'warn', 'error', 'debug'].forEach(type => { @@ -32,4 +32,4 @@ describe('Custom-Formatting', () => { expect(lastMsgOfType[type]).to.equal('['+type+'] [lel] foo'); }); }); -}); \ No newline at end of file +}); diff --git a/test/integration-tests/custom-log-levels.test.js b/test/integration-tests/custom-log-levels.test.js index 092e76b..1a3c7c2 100644 --- a/test/integration-tests/custom-log-levels.test.js +++ b/test/integration-tests/custom-log-levels.test.js @@ -27,7 +27,7 @@ describe('Custom-Log-levels', () => { } })) throw 'This will never happen'; - it('should work', () => { + it('should only emit log if type has equal or lower log level', () => { [ [-1, 0], [0, 1], @@ -41,11 +41,11 @@ describe('Custom-Log-levels', () => { messages = []; better.logLevel = level; - better.line('foo'); - better.debug('foo'); - better.log('foo') - better.info('foo'); - better.warn('foo'); + better.line('foo'); + better.debug('foo'); + better.log('foo') + better.info('foo'); + better.warn('foo'); better.error('foo'); expect(messages.length, `Expected [${messages.join(', ')}] to be of length ${count}`).to.equal(count); diff --git a/test/integration-tests/log-object.test.js b/test/integration-tests/log-object.test.js index 3452c56..44042bb 100644 --- a/test/integration-tests/log-object.test.js +++ b/test/integration-tests/log-object.test.js @@ -1,13 +1,12 @@ //@ts-check const { expect } = require('chai'); -const { CustomInstance } = require('../../dist/api'); -const { removeColors } = require('../../dist/lib/util/removeColor'); +const { CustomInstance, Theme } = require('../../dist/api'); describe('Log-Object', () => { const lastMsgOfType = {} const catchLog = type => msg => { - lastMsgOfType[type] = removeColors(msg); + lastMsgOfType[type] = msg; } const pretendLogger = CustomInstance({ log: catchLog('log'), @@ -20,6 +19,7 @@ describe('Log-Object', () => { const better = {}; if (!pretendLogger(better, { format: ctx => ctx.msg, + color: Theme.noColor, })) throw 'This will never happen'; better.logLevel = 5; @@ -28,24 +28,24 @@ describe('Log-Object', () => { const testStringify = (...data) => { better[loggerType](...data); expect(lastMsgOfType[nativeType]).to.equal( - data.map(d => - typeof d === 'object' + data.map(d => + typeof d === 'object' ? JSON.stringify(d) : String(d) ).join(' ') ); } - + testStringify({ foo: 'bar' }); testStringify([ 'foo', 'bar' ]); testStringify(class Foo { bar() {} }); testStringify(() => {}); testStringify(function () {}); testStringify('string', { foo: 'bar' }, 2); - testStringify([ 'foo', 'bar' ], { foo: 'bar' }, [ 'bar', 'foo' ], { bar: 'foo' }); + testStringify([ 'foo', 'bar' ], { foo: 'bar' }, [ 'bar', 'foo' ], { bar: 'foo' }); }); } - ['log', 'info', 'warn', 'error', 'debug'].forEach(type => + ['log', 'info', 'warn', 'error', 'debug'].forEach(type => runTest(type, type) ); -}); \ No newline at end of file +}); diff --git a/test/integration-tests/message-construction-strategy.test.js b/test/integration-tests/message-construction-strategy.test.js index d192e7c..0f7f72d 100644 --- a/test/integration-tests/message-construction-strategy.test.js +++ b/test/integration-tests/message-construction-strategy.test.js @@ -1,12 +1,11 @@ //@ts-check const { expect } = require('chai'); -const { CustomInstance, MessageConstructionStrategy } = require('../../dist/api'); -const { removeColors } = require('../../dist/lib/util/removeColor'); +const { CustomInstance, MessageConstructionStrategy, Theme } = require('../../dist/api'); describe('Message-Construction-Strategy', () => { const lastMsgOfType = {} const catchLog = type => (msg, ...args) => { - lastMsgOfType[type] = [removeColors(msg), args]; + lastMsgOfType[type] = [msg, args]; } const pretendLogger = CustomInstance({ log: catchLog('log'), @@ -21,11 +20,12 @@ describe('Message-Construction-Strategy', () => { if (!pretendLogger(better, { messageConstructionStrategy: MessageConstructionStrategy.NONE, format: ctx => ctx.msg, + color: Theme.noColor, })) throw 'This will never happen'; better.logLevel = 5; - + it('#line()', () => { - better.line('foo', {}); + better.line('foo', {}); expect(lastMsgOfType.log[0]).to.equal('foo'); expect(lastMsgOfType.log[1]).to.deep.equal([ {} ]); }); @@ -43,11 +43,12 @@ describe('Message-Construction-Strategy', () => { if (!pretendLogger(better, { messageConstructionStrategy: MessageConstructionStrategy.FIRST, format: ctx => ctx.msg, + color: Theme.noColor, })) throw 'This will never happen'; better.logLevel = 5; - + it('#line()', () => { - better.line('foo', {}); + better.line('foo', {}); expect(lastMsgOfType.log[0]).to.equal('foo'); expect(lastMsgOfType.log[1]).to.deep.equal([ {} ]); }); @@ -65,11 +66,12 @@ describe('Message-Construction-Strategy', () => { if (!pretendLogger(better, { messageConstructionStrategy: MessageConstructionStrategy.ALL, format: ctx => ctx.msg, + color: Theme.noColor, })) throw 'This will never happen'; better.logLevel = 5; - + it('#line()', () => { - better.line('foo', {}); + better.line('foo', {}); expect(lastMsgOfType.log[0]).to.equal('foo'); expect(lastMsgOfType.log[1]).to.deep.equal([ {} ]); }); @@ -81,4 +83,4 @@ describe('Message-Construction-Strategy', () => { }); }); }); -}); \ No newline at end of file +}); diff --git a/test/integration-tests/multiple-implementation-ojects.test.js b/test/integration-tests/multiple-implementation-ojects.test.js index 692f0ed..04ba641 100644 --- a/test/integration-tests/multiple-implementation-ojects.test.js +++ b/test/integration-tests/multiple-implementation-ojects.test.js @@ -14,7 +14,7 @@ describe('Multiple-Implementation-Objects', () => { debug: catchLog(implNr), error: catchLog(implNr), warn: catchLog(implNr), - }); + }); const implCount = 5; const pretendLogger = CustomInstance( @@ -41,4 +41,4 @@ describe('Multiple-Implementation-Objects', () => { } }); }); -}); \ No newline at end of file +}); diff --git a/test/integration-tests/save-to-file.test.js b/test/integration-tests/save-to-file.test.js index d23c1fc..164c7c4 100644 --- a/test/integration-tests/save-to-file.test.js +++ b/test/integration-tests/save-to-file.test.js @@ -4,41 +4,42 @@ const { Volume, createFsFromVolume } = require('memfs'); const { LoggerContext } = require('../../dist/lib/logger'); describe('Save-To-File', () => { - const fs = createFsFromVolume(Volume.fromJSON({})); + it('should save logs to file when "saveToFile" config is provided', () => { + const fs = createFsFromVolume(Volume.fromJSON({})); - const pretendLogger = new LoggerContext({ - log: () => { }, - info: () => { }, - debug: () => { }, - error: () => { }, - warn: () => { }, - }, - //@ts-ignore - fs - ); + const pretendLogger = new LoggerContext({ + log: () => { }, + info: () => { }, + debug: () => { }, + error: () => { }, + warn: () => { }, + }, + //@ts-ignore + fs + ); - const logFilePath = '/latest.log'; + const logFilePath = '/latest.log'; - const better = {}; - if (!pretendLogger.decorate(better, { - format: ctx => `${ctx.type} ${ctx.msg}`, - saveToFile: logFilePath, - })) throw 'This will never happen'; + const better = {}; + if (!pretendLogger.decorate(better, { + format: ctx => `${ctx.type} ${ctx.msg}`, + saveToFile: logFilePath, + })) throw 'This will never happen'; - better.log('Test'); - better.info('Test'); - better.warn('Test'); - better.error('Test'); - better.debug('Test'); + better.log('Test'); + better.info('Test'); + better.warn('Test'); + better.error('Test'); + better.debug('Test'); - const contents = fs.readFileSync(logFilePath).toString(); - console.log(contents.split('\n')); - expect(contents.split('\n')).to.deep.equal([ - '[log] Test', - '[info] Test', - '[warn] Test', - '[error] Test', - '[debug] Test', - '' /* Each log line ends with a \n so there will be an empty line at the end */ - ]); -}); \ No newline at end of file + const contents = fs.readFileSync(logFilePath).toString(); + expect(contents.split('\n')).to.deep.equal([ + '[log] Test', + '[info] Test', + '[warn] Test', + '[error] Test', + '[debug] Test', + '' /* Each log line ends with a \n so there will be an empty line at the end */ + ]); + }) +}); diff --git a/test/integration-tests/theme.test.js b/test/integration-tests/theme.test.js new file mode 100644 index 0000000..0c54f8a --- /dev/null +++ b/test/integration-tests/theme.test.js @@ -0,0 +1,34 @@ +//@ts-check +const { expect } = require('chai'); +const { CustomInstance, Theme } = require('../../dist/api'); + +describe('Theme', () => { + describe('noColor', () => { + const lastMsgOfType = {} + const catchLog = type => msg => { + lastMsgOfType[type] = msg; + } + const pretendLogger = CustomInstance({ + log: catchLog('log'), + info: catchLog('info'), + debug: catchLog('debug'), + error: catchLog('error'), + warn: catchLog('warn'), + }); + + const better = {}; + if (!pretendLogger(better, { + color: Theme.noColor, + format: ctx => `${ctx.type} ${ctx.msg}`, + })) throw 'This will never happen'; + better.logLevel = 4; + + it('should produce messages that dont contain ANSI color strings', () => { + ['log', 'info', 'warn', 'error', 'debug'].forEach(type => { + const msg = 'foo'; + better[type](msg); + expect(lastMsgOfType[type]).to.equal(`[${type}] ${msg}`); + }); + }); + }); +}); diff --git a/test/unit-tests/format-message.test.js b/test/unit-tests/format-message.test.js index d76c333..b3593a9 100644 --- a/test/unit-tests/format-message.test.js +++ b/test/unit-tests/format-message.test.js @@ -1,9 +1,9 @@ //@ts-check const { expect } = require('chai'); +const { Theme } = require('../../dist/api'); const { Config, DefaultConfig } = require('../../dist/lib/config'); const { MessageConstructionStrategy } = require('../../dist/lib/enums/messageConstructionStrategy'); const { formatMessage } = require('../../dist/lib/formatMessage'); -const { removeColors } = require('../../dist/lib/util/removeColor'); describe('Format-Message', () => { it('MessageConstructionStrategy.FIRST', () => { @@ -11,12 +11,13 @@ describe('Format-Message', () => { ...DefaultConfig, format: ctx => ctx.msg, messageConstructionStrategy: MessageConstructionStrategy.FIRST, + color: Theme.noColor, }); const input = [1, 2, 3]; const [message, rest] = formatMessage('log', config, input); - expect(removeColors(message)).to.equal('1'); + expect(message).to.equal('1'); expect(rest).to.deep.equal([2, 3]); }); @@ -25,12 +26,13 @@ describe('Format-Message', () => { ...DefaultConfig, format: ctx => ctx.msg, messageConstructionStrategy: MessageConstructionStrategy.ALL, + color: Theme.noColor, }); const input = [1, 2, 3]; const [message, rest] = formatMessage('log', config, input); - expect(removeColors(message)).to.equal('1 2 3'); + expect(message).to.equal('1 2 3'); expect(rest).to.deep.equal([]); }); @@ -39,12 +41,13 @@ describe('Format-Message', () => { ...DefaultConfig, format: ctx => ctx.msg, messageConstructionStrategy: MessageConstructionStrategy.NONE, + color: Theme.noColor, }); const input = [1, 2, 3]; const [message, rest] = formatMessage('log', config, input); - expect(removeColors(message)).to.equal(''); + expect(message).to.equal(''); expect(rest).to.deep.equal([1, 2, 3]); }); @@ -54,12 +57,13 @@ describe('Format-Message', () => { ...DefaultConfig, format: ctx => ctx.type, formatStamp: content => `START-${content}-END`, + color: Theme.noColor, }); const input = [1, 2, 3]; const [message, rest] = formatMessage('log', config, input); - expect(removeColors(message)).to.equal('START-log-END'); + expect(message).to.equal('START-log-END'); expect(rest).to.deep.equal([]); }) })