@elyukai/utils 0.3.1 → 0.3.3
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/CHANGELOG.md +9 -0
- package/dist/src/debug.d.ts +16 -0
- package/dist/src/debug.js +25 -0
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [commit-and-tag-version](https://github.com/absolute-version/commit-and-tag-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
## [0.3.3](https://github.com/elyukai/ts-utils/compare/v0.3.2...v0.3.3) (2026-03-20)
|
|
6
|
+
|
|
7
|
+
## [0.3.2](https://github.com/elyukai/ts-utils/compare/v0.3.1...v0.3.2) (2026-03-13)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* add debugging helpers ([a06fab4](https://github.com/elyukai/ts-utils/commit/a06fab4b63db49777968a9755ffb6958b743e305))
|
|
13
|
+
|
|
5
14
|
## [0.3.1](https://github.com/elyukai/ts-utils/compare/v0.3.0...v0.3.1) (2026-03-13)
|
|
6
15
|
|
|
7
16
|
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*´Utility function for debugging purposes.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Logs a message to the console and returns the provided value.
|
|
7
|
+
*/
|
|
8
|
+
export declare const trace: <T>(value: T, message: unknown) => T;
|
|
9
|
+
/**
|
|
10
|
+
* Logs a value and returns it afterwards.
|
|
11
|
+
*/
|
|
12
|
+
export declare const traceId: <T>(value: T) => T;
|
|
13
|
+
/**
|
|
14
|
+
* Logs the result of applying a function to a value and returns the value.
|
|
15
|
+
*/
|
|
16
|
+
export declare const traceWith: <T>(value: T, fn: (value: T) => unknown) => T;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
*´Utility function for debugging purposes.
|
|
3
|
+
* @module
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Logs a message to the console and returns the provided value.
|
|
7
|
+
*/
|
|
8
|
+
export const trace = (value, message) => {
|
|
9
|
+
console.log(message);
|
|
10
|
+
return value;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Logs a value and returns it afterwards.
|
|
14
|
+
*/
|
|
15
|
+
export const traceId = (value) => {
|
|
16
|
+
console.log(value);
|
|
17
|
+
return value;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Logs the result of applying a function to a value and returns the value.
|
|
21
|
+
*/
|
|
22
|
+
export const traceWith = (value, fn) => {
|
|
23
|
+
console.log(fn(value));
|
|
24
|
+
return value;
|
|
25
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@elyukai/utils",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "A set of JavaScript helper functions.",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -33,14 +33,14 @@
|
|
|
33
33
|
"homepage": "https://github.com/elyukai/ts-utils#readme",
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@eslint/js": "^10.0.1",
|
|
36
|
-
"@types/node": "^25.
|
|
37
|
-
"commit-and-tag-version": "^12.
|
|
38
|
-
"eslint": "^10.0.
|
|
39
|
-
"eslint-plugin-jsdoc": "^62.
|
|
36
|
+
"@types/node": "^25.5.0",
|
|
37
|
+
"commit-and-tag-version": "^12.7.1",
|
|
38
|
+
"eslint": "^10.0.3",
|
|
39
|
+
"eslint-plugin-jsdoc": "^62.8.0",
|
|
40
40
|
"prettier": "^3.8.1",
|
|
41
41
|
"tsx": "^4.21.0",
|
|
42
42
|
"typescript": "^5.9.3",
|
|
43
|
-
"typescript-eslint": "^8.
|
|
43
|
+
"typescript-eslint": "^8.57.1"
|
|
44
44
|
},
|
|
45
45
|
"type": "module"
|
|
46
46
|
}
|