larvitutils 4.0.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -4
- package/package.json +13 -14
package/README.md
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
[](https://travis-ci.org/larvit/larvitutils)
|
|
2
2
|
[](https://david-dm.org/larvit/larvitutils.svg)
|
|
3
|
-
[](https://coveralls.io/github/larvit/larvitutils)
|
|
4
3
|
|
|
5
4
|
# larvitutils
|
|
6
5
|
|
|
@@ -34,6 +33,8 @@ const utils = new Utils({ log });
|
|
|
34
33
|
|
|
35
34
|
Very summarized, see specific commits for more details
|
|
36
35
|
|
|
36
|
+
v5.0.0 - Updated dependency versions and fixed some TypeScript errors. Removed coveralls since it's dependent on deprecated packages.
|
|
37
|
+
|
|
37
38
|
v4.0.2 - Even stricter control of process not being set for some environments
|
|
38
39
|
|
|
39
40
|
v4.0.1 - Fixed bug where process.env.NODE_LOG_LVL was expected to be set in browsers if no log level was provided on instansiation
|
package/dist/index.d.ts
CHANGED
|
@@ -55,7 +55,7 @@ declare class Utils {
|
|
|
55
55
|
* @return {string} The result
|
|
56
56
|
*/
|
|
57
57
|
replaceAll(search: string, replace: string, str: string): string;
|
|
58
|
-
setTimeout(ms: number): Promise<
|
|
58
|
+
setTimeout(ms: number): Promise<void>;
|
|
59
59
|
/**
|
|
60
60
|
* Make a buffer from an uuid string
|
|
61
61
|
*
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Log = exports.Utils = void 0;
|
|
1
4
|
const topLogPrefix = 'larvitutils: src/index.ts: ';
|
|
2
5
|
class Log {
|
|
3
6
|
/**
|
|
@@ -93,6 +96,7 @@ class Log {
|
|
|
93
96
|
return false;
|
|
94
97
|
}
|
|
95
98
|
}
|
|
99
|
+
exports.Log = Log;
|
|
96
100
|
class Utils {
|
|
97
101
|
constructor(options) {
|
|
98
102
|
this.Log = Log;
|
|
@@ -101,7 +105,7 @@ class Utils {
|
|
|
101
105
|
this.log = this.options.log;
|
|
102
106
|
}
|
|
103
107
|
else {
|
|
104
|
-
this.log = this.options.log = new
|
|
108
|
+
this.log = this.options.log = new Log();
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
getUniqueCombinations(keyValues) {
|
|
@@ -152,7 +156,7 @@ class Utils {
|
|
|
152
156
|
return ((diff[0] * 1000) + (diff[1] / 1000000)).toFixed(precision);
|
|
153
157
|
}
|
|
154
158
|
escapeRegExp(str) {
|
|
155
|
-
return str.replace(/([.*+?^=!:${}()
|
|
159
|
+
return str.replace(/([.*+?^=!:${}()|[\]/\\])/g, '\\$1');
|
|
156
160
|
}
|
|
157
161
|
/**
|
|
158
162
|
* Formats an uuid string
|
|
@@ -239,7 +243,6 @@ class Utils {
|
|
|
239
243
|
if (isNaN(value)) {
|
|
240
244
|
return false;
|
|
241
245
|
}
|
|
242
|
-
// tslint:disable-next-line:no-bitwise
|
|
243
246
|
return (x | 0) === x;
|
|
244
247
|
}
|
|
245
248
|
isLogInstance(logInstance) {
|
|
@@ -256,4 +259,4 @@ class Utils {
|
|
|
256
259
|
return false;
|
|
257
260
|
}
|
|
258
261
|
}
|
|
259
|
-
|
|
262
|
+
exports.Utils = Utils;
|
package/package.json
CHANGED
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "larvitutils",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Misc utils",
|
|
5
|
-
"type": "module",
|
|
6
5
|
"main": "./dist/index.js",
|
|
7
6
|
"files": [
|
|
8
7
|
"/dist"
|
|
9
8
|
],
|
|
10
9
|
"devDependencies": {
|
|
11
|
-
"@types/node": "
|
|
12
|
-
"@types/tape": "4.2
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
"
|
|
19
|
-
"typescript": "
|
|
10
|
+
"@types/node": "16.11.9",
|
|
11
|
+
"@types/tape": "4.13.2",
|
|
12
|
+
"@typescript-eslint/eslint-plugin": "5.4.0",
|
|
13
|
+
"@typescript-eslint/parser": "5.4.0",
|
|
14
|
+
"eslint": "8.3.0",
|
|
15
|
+
"nyc": "15.1.0",
|
|
16
|
+
"tape": "5.3.2",
|
|
17
|
+
"ts-node": "10.4.0",
|
|
18
|
+
"typescript": "4.5.2"
|
|
20
19
|
},
|
|
21
20
|
"scripts": {
|
|
22
|
-
"build": "rm -rf ./dist/* && tsc
|
|
23
|
-
"lint": "
|
|
24
|
-
"test": "npm run lint && npm run build && nyc
|
|
21
|
+
"build": "rm -rf ./dist/* && tsc && cp ./src/models.d.ts ./dist/",
|
|
22
|
+
"lint": "eslint ./src/* ./test/**/*.ts",
|
|
23
|
+
"test": "npm run lint && npm run build && ./node_modules/.bin/nyc ts-node -P ./tsconfig.json ./node_modules/tape/bin/tape test/**/*.ts"
|
|
25
24
|
},
|
|
26
25
|
"repository": {
|
|
27
26
|
"type": "git",
|