@guillaume-docquier/tools-ts 5.1.0 → 6.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 +16 -5
- package/dist/Assert.d.ts +1 -1
- package/dist/Assert.js +1 -1
- package/dist/Assert.js.map +1 -1
- package/dist/Datetime.d.ts +11 -0
- package/dist/Datetime.js +11 -0
- package/dist/Datetime.js.map +1 -0
- package/dist/{Measure.d.ts → Profile.d.ts} +1 -1
- package/dist/{Measure.js → Profile.js} +2 -2
- package/dist/{Measure.js.map → Profile.js.map} +1 -1
- package/dist/Range.js +1 -1
- package/dist/entry.tools-ts.d.ts +3 -1
- package/dist/entry.tools-ts.js +3 -1
- package/dist/entry.tools-ts.js.map +1 -1
- package/dist/errors/Rethrow.js +1 -1
- package/dist/errors/Rethrow.js.map +1 -1
- package/dist/logging/Logger.d.ts +2 -2
- package/dist/logging/Logger.js.map +1 -1
- package/dist/logging/sink/ConsoleLogSink.d.ts +1 -1
- package/dist/logging/sink/ConsoleLogSink.js +1 -1
- package/dist/logging/sink/ConsoleLogSink.js.map +1 -1
- package/dist/measurements/Measurement.d.ts +7 -0
- package/dist/measurements/Measurement.js +2 -0
- package/dist/measurements/Measurement.js.map +1 -0
- package/dist/measurements/Time.d.ts +37 -0
- package/dist/measurements/Time.js +53 -0
- package/dist/measurements/Time.js.map +1 -0
- package/package.json +43 -41
package/README.md
CHANGED
|
@@ -109,12 +109,23 @@ consistent.
|
|
|
109
109
|
| `asyncNoop` | Asynchronous no-op function. | You need a safe default async callback or hook that resolves immediately. |
|
|
110
110
|
| `omit` | Runtime equivalent of `Omit<TType, TKey>`. | You need to remove keys from an object. |
|
|
111
111
|
|
|
112
|
-
###
|
|
112
|
+
### Profiling
|
|
113
113
|
|
|
114
|
-
Use these helpers for
|
|
115
|
-
benchmarking.
|
|
114
|
+
Use these helpers for quick profiling.
|
|
116
115
|
|
|
117
116
|
| Export | What it is | Use it when |
|
|
118
117
|
| ----------------------- | ----------------------------------------------- | ------------------------------------------------------------------------------------ |
|
|
119
|
-
| `
|
|
120
|
-
| `
|
|
118
|
+
| `Profile.executionTime` | Wraps sync or async work and logs elapsed time. | You need quick timing instrumentation around a named operation. |
|
|
119
|
+
| `Profile.memoryUsage` | Logs process memory usage in megabytes. | You need a snapshot of Node.js process memory for diagnostics or runtime visibility. |
|
|
120
|
+
|
|
121
|
+
### Measurements
|
|
122
|
+
|
|
123
|
+
| Export | What it is | Use it when |
|
|
124
|
+
| ------ | ------------------------------------------------------------------- | ------------------------------------------------------------ |
|
|
125
|
+
| `Time` | Represent a time value with a unit and contains conversion methods. | You want to represent time and abstract away the units used. |
|
|
126
|
+
|
|
127
|
+
### Date manipulations
|
|
128
|
+
|
|
129
|
+
| Export | What it is | Use it when |
|
|
130
|
+
| -------------------- | ------------------------------------------ | --------------------------------------------------------------------- |
|
|
131
|
+
| `Datetime.increment` | Increments a date by a set amount of Time. | You need to increment time. Plays nicely with the `Time` measurement. |
|
package/dist/Assert.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { EnumType, ConstructorType } from "./utility-types.js";
|
|
2
1
|
import { Result, Success } from "./Result.js";
|
|
2
|
+
import type { EnumType, ConstructorType } from "./utility-types.js";
|
|
3
3
|
/**
|
|
4
4
|
* From Wikipedia
|
|
5
5
|
* In computer programming, [...] an assertion is a predicate connected to a point in the program, that always should evaluate to true at that point in code execution.
|
package/dist/Assert.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AssertionError } from "./errors/AssertionError.js";
|
|
2
|
-
import { TypeGuard } from "./TypeGuard.js";
|
|
3
2
|
import { Result } from "./Result.js";
|
|
3
|
+
import { TypeGuard } from "./TypeGuard.js";
|
|
4
4
|
/**
|
|
5
5
|
* From Wikipedia
|
|
6
6
|
* In computer programming, [...] an assertion is a predicate connected to a point in the program, that always should evaluate to true at that point in code execution.
|
package/dist/Assert.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Assert.js","sourceRoot":"","sources":["../src/Assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Assert.js","sourceRoot":"","sources":["../src/Assert.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAW,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAG1C;;;;;;;;;;;;GAYG;AAEH,MAAM,OAAO,MAAM;IACjB;;;;;;;;;;;;;OAaG;IACI,MAAM,CAAC,YAAY,CAExB,aAAqC,EACrC,eAAwB,EACxB,SAAkB;QAElB,IAAI,CAAC,CAAC,eAAe,YAAY,aAAa,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,cAAc,CACtB,wCAAwC,EACxC;gBACE,SAAS;gBACT,QAAQ,EAAE,aAAa,CAAC,IAAI;gBAC5B,QAAQ,EAAE,eAAe,EAAE,WAAW,CAAC,IAAI,IAAI,OAAO,eAAe;aACtE,EACD,MAAM,CAAC,YAAY,CACpB,CAAA;QACH,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,MAAM,CAAC,SAAS,CAAoB,YAAsC,EAAE,SAAkB;QACnG,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;YACxD,MAAM,IAAI,cAAc,CACtB,cAAc,EACd;gBACE,SAAS;gBACT,QAAQ,EAAE,4BAA4B;gBACtC,QAAQ,EAAE,oBAAoB,CAAC,YAAY,CAAC;aAC7C,EACD,MAAM,CAAC,SAAS,CACjB,CAAA;QACH,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACI,MAAM,CAAC,YAAY,CAExB,OAAc,EACd,cAAuB,EACvB,SAAkB;QAElB,IAAI,CAAC,SAA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,MAAM,CAAC,MAAM,CACd,CAAA;QACH,CAAC;IACH,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;IACI,MAAM,CAAC,WAAW,CAAa,KAAY;QAChD,MAAM,IAAI,cAAc,CACtB,mFAAmF,EACnF;YACE,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE,KAAK;SAChB,EACD,MAAM,CAAC,WAAW,CACnB,CAAA;IACH,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,SAAS,CAAgB,MAA0B,EAAE,SAAkB;QACnF,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,cAAc,CACtB,+BAA+B,EAC/B;gBACE,SAAS;gBACT,QAAQ,EAAE,WAAW;gBACrB,QAAQ,EAAE,cAAc,oBAAoB,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;aAC7D,EACD,MAAM,CAAC,SAAS,CACjB,CAAA;QACH,CAAC;IACH,CAAC;CACF;AAED;;;GAGG;AACH,SAAS,oBAAoB,CAAC,KAAc,EAAE,EAAE,YAAY,GAAG,KAAK,KAAiC,EAAE;IACrG,kBAAkB;IAClB,OAAO,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,WAAW;QACpC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,KAAK;YACjE,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK;gBACnC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAA;AAC7B,CAAC"}
|
package/dist/Datetime.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Time, UnitOfTime } from "./measurements/Time.js";
|
|
2
|
+
export const Datetime = {
|
|
3
|
+
/**
|
|
4
|
+
* Increments a date by x seconds
|
|
5
|
+
* A unit agnostic utility would be useful here
|
|
6
|
+
*/
|
|
7
|
+
increment: ({ date, time }) => {
|
|
8
|
+
return new Date(date.getTime() + Time.in(time, UnitOfTime.MILLISECONDS));
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=Datetime.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Datetime.js","sourceRoot":"","sources":["../src/Datetime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEzD,MAAM,CAAC,MAAM,QAAQ,GAAG;IACtB;;;OAGG;IACH,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAA8B,EAAQ,EAAE;QAC9D,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,CAAC,CAAA;IAC1E,CAAC;CACF,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type BasicLogger = {
|
|
2
2
|
info: (message: string, context?: Record<string, unknown>) => void;
|
|
3
3
|
};
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const Profile: {
|
|
5
5
|
executionTime: typeof executionTime;
|
|
6
6
|
/**
|
|
7
7
|
* Prints the current memory usage using {@link https://nodejs.org/api/process.html#processmemoryusage process.memoryUsage()}.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const
|
|
1
|
+
export const Profile = {
|
|
2
2
|
// You can't overload while defining object properties, which is why the function implementation is not inlined
|
|
3
3
|
executionTime,
|
|
4
4
|
/**
|
|
@@ -50,4 +50,4 @@ function logExecutionTime(label, startedAt, logger) {
|
|
|
50
50
|
function bytesToMb(bytes) {
|
|
51
51
|
return `${Math.round(bytes / 1024 / 1024).toFixed(2)} MB`;
|
|
52
52
|
}
|
|
53
|
-
//# sourceMappingURL=
|
|
53
|
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E,SAAiB,EAAE,MAAmB;IAC7E,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,KAAK,CAAC,WAAW,CAAC,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAC1E,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAA;AAC3D,CAAC"}
|
package/dist/Range.js
CHANGED
package/dist/entry.tools-ts.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { asArray } from "./asArray.js";
|
|
|
9
9
|
export { omit } from "./omit.js";
|
|
10
10
|
export { Assert } from "./Assert.js";
|
|
11
11
|
export { Result, type Success, type Failure } from "./Result.js";
|
|
12
|
-
export {
|
|
12
|
+
export { Profile } from "./Profile.js";
|
|
13
13
|
export { Range } from "./Range.js";
|
|
14
14
|
export { TypeGuard } from "./TypeGuard.js";
|
|
15
15
|
export { setTimeoutAsync } from "./setTimeoutAsync.js";
|
|
@@ -27,3 +27,5 @@ export { debounce } from "./debounce.js";
|
|
|
27
27
|
export { Sort } from "./Sort.js";
|
|
28
28
|
export { createRng, type Rng, type Generator } from "./rng/rng.js";
|
|
29
29
|
export { mulberry32Prng } from "./rng/mulberry32prng.js";
|
|
30
|
+
export { Datetime } from "./Datetime.js";
|
|
31
|
+
export { Time, UnitOfTime } from "./measurements/Time.js";
|
package/dist/entry.tools-ts.js
CHANGED
|
@@ -8,7 +8,7 @@ export { asArray } from "./asArray.js";
|
|
|
8
8
|
export { omit } from "./omit.js";
|
|
9
9
|
export { Assert } from "./Assert.js";
|
|
10
10
|
export { Result } from "./Result.js";
|
|
11
|
-
export {
|
|
11
|
+
export { Profile } from "./Profile.js";
|
|
12
12
|
export { Range } from "./Range.js";
|
|
13
13
|
export { TypeGuard } from "./TypeGuard.js";
|
|
14
14
|
export { setTimeoutAsync } from "./setTimeoutAsync.js";
|
|
@@ -22,4 +22,6 @@ export { debounce } from "./debounce.js";
|
|
|
22
22
|
export { Sort } from "./Sort.js";
|
|
23
23
|
export { createRng } from "./rng/rng.js";
|
|
24
24
|
export { mulberry32Prng } from "./rng/mulberry32prng.js";
|
|
25
|
+
export { Datetime } from "./Datetime.js";
|
|
26
|
+
export { Time, UnitOfTime } from "./measurements/Time.js";
|
|
25
27
|
//# sourceMappingURL=entry.tools-ts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.tools-ts.js","sourceRoot":"","sources":["../src/entry.tools-ts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACnD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAI5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAA8B,MAAM,aAAa,CAAA;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;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,SAAS,EAAE,MAAM,WAAW,CAAA;AAE3C,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAA;AAC5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAA;AAEtF,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAA;AAKvE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAChC,OAAO,EAAE,SAAS,EAA4B,MAAM,cAAc,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AACxD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA"}
|
package/dist/errors/Rethrow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Rethrow.js","sourceRoot":"","sources":["../../src/errors/Rethrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"Rethrow.js","sourceRoot":"","sources":["../../src/errors/Rethrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE5C,MAAM,OAAO,OAAO;IAClB;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACI,MAAM,CAAC,OAAO,CAAa,UAAmB;QACnD,IAAI,CAAC,CAAC,UAAU,YAAY,KAAK,CAAC,EAAE,CAAC;YACnC,MAAM,IAAI,cAAc,CACtB,gCAAgC,EAChC,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,EACpE,OAAO,CAAC,OAAO,CAChB,CAAA;QACH,CAAC;QAED,IAAI,UAAU,YAAY,UAAU,EAAE,CAAC;YACrC,MAAM,UAAU,CAAA;QAClB,CAAC;IACH,CAAC;CACF"}
|
package/dist/logging/Logger.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { LogSink } from "./sink/LogSink.js";
|
|
2
|
-
import type { LogContextProvider } from "./log-context/LogContextProvider.js";
|
|
3
1
|
import type { LogContext } from "./log-context/LogContext.js";
|
|
2
|
+
import type { LogContextProvider } from "./log-context/LogContextProvider.js";
|
|
3
|
+
import type { LogSink } from "./sink/LogSink.js";
|
|
4
4
|
/**
|
|
5
5
|
* The fully featured logger for .
|
|
6
6
|
* You can learn more about its capabilities in the {@link https://github.com/Co/tech-toolbox/tree/main/tech-toolbox/docs/logging.md|documentation}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/logging/Logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../src/logging/Logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,EAAgC,MAAM,kBAAkB,CAAA;AAC5F,OAAO,EACL,aAAa,EACb,aAAa,EACb,6BAA6B,EAC7B,4BAA4B,EAC5B,qBAAqB,GACtB,MAAM,+BAA+B,CAAA;AAMtC;;;GAGG;AACH,MAAM,OAAO,MAAM;IACjB;;OAEG;IACc,MAAM,CAAe;IAEtC;;OAEG;IACc,MAAM,CAAmB;IAE1C;;OAEG;IACK,aAAa,CAAwB;IAE7C;;OAEG;IACK,gBAAgB,CAA+B;IAEvD;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,EAC5B,KAAK,EACL,OAAO,EACP,gBAAgB,GAAG,EAAE,GAkBtB;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;;OAIG;IACI,KAAK,CAAC,OAAe,EAAE,cAA2B;QACvD,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,IAAI,CAAC,aAAa,CAAC,cAAc,CAAC,CAAC,CAAA;IAChE,CAAC;IAEO,aAAa,CAAC,cAA2B;QAC/C,MAAM,cAAc,GAAG,EAAE,CAAA;QACzB,KAAK,MAAM,QAAQ,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC7C,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAA;QACtD,CAAC;QAED,0DAA0D;QAC1D,wCAAwC;QACxC,OAAO;YACL,GAAG,cAAc;YACjB,GAAG,cAAc;YACjB,GAAG,IAAI,CAAC,aAAa;YACrB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { LogSink } from "./LogSink.ts";
|
|
2
1
|
import { type ConsoleSinkOptions } from "@logtape/logtape";
|
|
3
2
|
import { type FieldRedactionOptions } from "@logtape/redaction";
|
|
3
|
+
import type { LogSink } from "./LogSink.ts";
|
|
4
4
|
type RedactionOptions = {
|
|
5
5
|
enabled: boolean;
|
|
6
6
|
action?: FieldRedactionOptions["action"];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getConsoleSink } from "@logtape/logtape";
|
|
2
2
|
import { redactByField } from "@logtape/redaction";
|
|
3
|
-
import { RECOMMENDED_LOG_REDACTION } from "../redaction.js";
|
|
4
3
|
import { jsonLineFormatter } from "../formatter/jsonLineFormatter.js";
|
|
4
|
+
import { RECOMMENDED_LOG_REDACTION } from "../redaction.js";
|
|
5
5
|
/**
|
|
6
6
|
* Creates a log sink to output to the console.
|
|
7
7
|
* The default parameters are production-appropriate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConsoleLogSink.js","sourceRoot":"","sources":["../../../src/logging/sink/ConsoleLogSink.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ConsoleLogSink.js","sourceRoot":"","sources":["../../../src/logging/sink/ConsoleLogSink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA2B,MAAM,kBAAkB,CAAA;AAC1E,OAAO,EAAE,aAAa,EAA8B,MAAM,oBAAoB,CAAA;AAC9E,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AACrE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iBAAiB,CAAA;AAS3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,UAAU,oBAAoB,CAAC,EACnC,SAAS,GAAG,iBAAiB,EAC7B,WAAW,GAAG,IAAI,EAClB,SAAS,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAoB3B,EAAE;IACJ,MAAM,IAAI,GAAY,cAAc,CAAC;QACnC,SAAS;QACT,WAAW;KACZ,CAAC,CAAA;IAEF,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;QACvB,OAAO,IAAI,CAAA;IACb,CAAC;IAED,OAAO,aAAa,CAAC,IAAI,EAAE;QACzB,aAAa,EAAE,SAAS,CAAC,aAAa,IAAI,yBAAyB,CAAC,aAAa;QACjF,MAAM,EAAE,SAAS,CAAC,MAAM,IAAI,yBAAyB,CAAC,MAAM;KAC7D,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Measurement.js","sourceRoot":"","sources":["../../src/measurements/Measurement.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Measurement } from "./Measurement.js";
|
|
2
|
+
/**
|
|
3
|
+
* Represents the possible units to define time.
|
|
4
|
+
*/
|
|
5
|
+
export declare enum UnitOfTime {
|
|
6
|
+
MILLISECONDS = "milliseconds",
|
|
7
|
+
SECONDS = "seconds",
|
|
8
|
+
MINUTES = "minutes",
|
|
9
|
+
HOURS = "hours"
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Represents a time with its unit
|
|
13
|
+
*/
|
|
14
|
+
export type Time = Measurement<UnitOfTime>;
|
|
15
|
+
/**
|
|
16
|
+
* A set of functions to work with Times.
|
|
17
|
+
*/
|
|
18
|
+
export declare const Time: {
|
|
19
|
+
create: (value: number, unit: UnitOfTime) => {
|
|
20
|
+
value: number;
|
|
21
|
+
unit: UnitOfTime;
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Converts a time to another unit of time.
|
|
25
|
+
* The provided time is left untouched.
|
|
26
|
+
* @param time The time to convert.
|
|
27
|
+
* @param newUnit The new unit to convert to.
|
|
28
|
+
* @returns A new Time with the requested unit of time.
|
|
29
|
+
*/
|
|
30
|
+
convert(time: Time, newUnit: UnitOfTime): Time;
|
|
31
|
+
/**
|
|
32
|
+
* Returns the value of the time in the given unit of time.
|
|
33
|
+
* @param time The time to get the value of.
|
|
34
|
+
* @param newUnit The unit of time to get the value of the time in.
|
|
35
|
+
*/
|
|
36
|
+
in(time: Time, newUnit: UnitOfTime): number;
|
|
37
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents the possible units to define time.
|
|
3
|
+
*/
|
|
4
|
+
export var UnitOfTime;
|
|
5
|
+
(function (UnitOfTime) {
|
|
6
|
+
UnitOfTime["MILLISECONDS"] = "milliseconds";
|
|
7
|
+
UnitOfTime["SECONDS"] = "seconds";
|
|
8
|
+
UnitOfTime["MINUTES"] = "minutes";
|
|
9
|
+
UnitOfTime["HOURS"] = "hours";
|
|
10
|
+
})(UnitOfTime || (UnitOfTime = {}));
|
|
11
|
+
/**
|
|
12
|
+
* The definition of factors of time, where the base unit is the second.
|
|
13
|
+
* 1 minute is 1/60th of a second.
|
|
14
|
+
*/
|
|
15
|
+
const TIME_PER_SECONDS = {
|
|
16
|
+
[UnitOfTime.MILLISECONDS]: 1000,
|
|
17
|
+
[UnitOfTime.SECONDS]: 1,
|
|
18
|
+
[UnitOfTime.MINUTES]: 1 / 60,
|
|
19
|
+
[UnitOfTime.HOURS]: 1 / 60 / 60,
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* A set of functions to work with Times.
|
|
23
|
+
*/
|
|
24
|
+
export const Time = {
|
|
25
|
+
create: (value, unit) => {
|
|
26
|
+
return {
|
|
27
|
+
value,
|
|
28
|
+
unit,
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
/**
|
|
32
|
+
* Converts a time to another unit of time.
|
|
33
|
+
* The provided time is left untouched.
|
|
34
|
+
* @param time The time to convert.
|
|
35
|
+
* @param newUnit The new unit to convert to.
|
|
36
|
+
* @returns A new Time with the requested unit of time.
|
|
37
|
+
*/
|
|
38
|
+
convert(time, newUnit) {
|
|
39
|
+
return {
|
|
40
|
+
value: Time.in(time, newUnit),
|
|
41
|
+
unit: newUnit,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Returns the value of the time in the given unit of time.
|
|
46
|
+
* @param time The time to get the value of.
|
|
47
|
+
* @param newUnit The unit of time to get the value of the time in.
|
|
48
|
+
*/
|
|
49
|
+
in(time, newUnit) {
|
|
50
|
+
return (time.value * TIME_PER_SECONDS[newUnit]) / TIME_PER_SECONDS[time.unit];
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=Time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Time.js","sourceRoot":"","sources":["../../src/measurements/Time.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,CAAN,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,2CAA6B,CAAA;IAC7B,iCAAmB,CAAA;IACnB,iCAAmB,CAAA;IACnB,6BAAe,CAAA;AACjB,CAAC,EALW,UAAU,KAAV,UAAU,QAKrB;AAED;;;GAGG;AACH,MAAM,gBAAgB,GAA+B;IACnD,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,IAAI;IAC/B,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;IACvB,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE;IAC5B,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE;CAChC,CAAA;AAOD;;GAEG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,MAAM,EAAE,CAAC,KAAa,EAAE,IAAgB,EAAE,EAAE;QAC1C,OAAO;YACL,KAAK;YACL,IAAI;SACL,CAAA;IACH,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CAAC,IAAU,EAAE,OAAmB;QACrC,OAAO;YACL,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC;YAC7B,IAAI,EAAE,OAAO;SACd,CAAA;IACH,CAAC;IAED;;;;OAIG;IACH,EAAE,CAAC,IAAU,EAAE,OAAmB;QAChC,OAAO,CAAC,IAAI,CAAC,KAAK,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAC/E,CAAC;CACF,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guillaume-docquier/tools-ts",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0",
|
|
4
4
|
"description": "My personal collection of typescript tools",
|
|
5
5
|
"homepage": "https://github.com/Guillaume-Docquier/tools-ts",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"author": "Guillaume Docquier",
|
|
6
8
|
"repository": {
|
|
7
9
|
"type": "git",
|
|
8
10
|
"url": "git+https://github.com/Guillaume-Docquier/tools-ts.git"
|
|
9
11
|
},
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
12
15
|
"type": "module",
|
|
13
16
|
"exports": {
|
|
14
17
|
".": {
|
|
@@ -16,35 +19,9 @@
|
|
|
16
19
|
"import": "./dist/entry.tools-ts.js"
|
|
17
20
|
}
|
|
18
21
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
"scripts": {
|
|
23
|
-
"build": "rm -rf dist && tsc --project tsconfig.build.json",
|
|
24
|
-
"checks": "pnpm lint:fix && pnpm format:fix && pnpm typecheck && pnpm test --run",
|
|
25
|
-
"format": "prettier --check . && pnpm format:package-json --check",
|
|
26
|
-
"format:fix": "prettier --write --list-different . && pnpm format:package-json",
|
|
27
|
-
"format:package-json": "sort-package-json package.json",
|
|
28
|
-
"lint": "eslint . --max-warnings 0",
|
|
29
|
-
"lint:fix": "pnpm lint --fix",
|
|
30
|
-
"prepack": "pnpm build",
|
|
31
|
-
"prepare": "husky",
|
|
32
|
-
"prepublishOnly": "pnpm i",
|
|
33
|
-
"test": "vitest",
|
|
34
|
-
"test:coverage": "vitest run --coverage",
|
|
35
|
-
"typecheck": "tsc -b --noEmit"
|
|
36
|
-
},
|
|
37
|
-
"lint-staged": {
|
|
38
|
-
"*package.json": "sort-package-json",
|
|
39
|
-
"*.{md,json,yml,yaml,css,scss}": "prettier --write",
|
|
40
|
-
"*.{js,jsx,ts,tsx}": [
|
|
41
|
-
"eslint --fix",
|
|
42
|
-
"prettier --write"
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
"prettier": {
|
|
46
|
-
"printWidth": 140,
|
|
47
|
-
"semi": false
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public",
|
|
24
|
+
"provenance": true
|
|
48
25
|
},
|
|
49
26
|
"dependencies": {
|
|
50
27
|
"@logtape/logtape": "^2.1.1",
|
|
@@ -53,8 +30,8 @@
|
|
|
53
30
|
"devDependencies": {
|
|
54
31
|
"@eslint/js": "^10.0.1",
|
|
55
32
|
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
33
|
+
"@semantic-release/exec": "^7.1.0",
|
|
56
34
|
"@semantic-release/github": "^12.0.8",
|
|
57
|
-
"@semantic-release/npm": "^13.1.5",
|
|
58
35
|
"@semantic-release/release-notes-generator": "^14.1.1",
|
|
59
36
|
"@types/node": "^25.9.1",
|
|
60
37
|
"@vitest/coverage-v8": "^4.1.7",
|
|
@@ -63,16 +40,41 @@
|
|
|
63
40
|
"husky": "^9.1.7",
|
|
64
41
|
"jiti": "^2.7.0",
|
|
65
42
|
"lint-staged": "^16.4.0",
|
|
66
|
-
"
|
|
43
|
+
"oxfmt": "^0.54.0",
|
|
67
44
|
"semantic-release": "^25.0.3",
|
|
68
|
-
"sort-package-json": "^3.6.1",
|
|
69
45
|
"typescript": "~6.0.3",
|
|
70
46
|
"typescript-eslint": "^8.59.4",
|
|
71
|
-
"vitest": "^4.1.7"
|
|
47
|
+
"vitest": "^4.1.7",
|
|
48
|
+
"node": "runtime:24.16.0"
|
|
72
49
|
},
|
|
73
|
-
"
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
|
|
50
|
+
"lint-staged": {
|
|
51
|
+
"*.{md,json,yml,yaml,css,scss}": "oxfmt --no-error-on-unmatched-pattern",
|
|
52
|
+
"*.{js,jsx,ts,tsx}": [
|
|
53
|
+
"eslint --fix",
|
|
54
|
+
"oxfmt --no-error-on-unmatched-pattern"
|
|
55
|
+
]
|
|
56
|
+
},
|
|
57
|
+
"devEngines": {
|
|
58
|
+
"packageManager": {
|
|
59
|
+
"name": "pnpm",
|
|
60
|
+
"version": "11.7.0",
|
|
61
|
+
"onFail": "download"
|
|
62
|
+
},
|
|
63
|
+
"runtime": {
|
|
64
|
+
"name": "node",
|
|
65
|
+
"version": "24.16.0",
|
|
66
|
+
"onFail": "download"
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
"scripts": {
|
|
70
|
+
"build": "rm -rf dist && tsc --project tsconfig.build.json",
|
|
71
|
+
"checks": "pnpm lint:fix && pnpm format:fix && pnpm typecheck && pnpm test --run",
|
|
72
|
+
"format": "oxfmt --check",
|
|
73
|
+
"format:fix": "oxfmt",
|
|
74
|
+
"lint": "eslint . --max-warnings 0",
|
|
75
|
+
"lint:fix": "pnpm lint --fix",
|
|
76
|
+
"test": "vitest",
|
|
77
|
+
"test:coverage": "vitest run --coverage",
|
|
78
|
+
"typecheck": "tsc -b --noEmit"
|
|
77
79
|
}
|
|
78
|
-
}
|
|
80
|
+
}
|