@bgord/tools 0.12.19 → 0.12.22
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/dist/clock.vo.d.ts +2 -2
- package/dist/date-range.vo.d.ts +1 -1
- package/dist/day.vo.d.ts +3 -3
- package/dist/day.vo.js +1 -1
- package/dist/filter.vo.d.ts +1 -1
- package/dist/iban-mask.service.d.ts +1 -1
- package/dist/mean.service.d.ts +1 -1
- package/dist/min-max-scaler.service.d.ts +1 -1
- package/dist/money.vo.d.ts +1 -1
- package/dist/percentage.service.d.ts +1 -1
- package/dist/population-standard-deviation.service.d.ts +1 -1
- package/dist/rate-limiter.service.d.ts +1 -1
- package/dist/revision.vo.d.ts +1 -1
- package/dist/simple-linear-regression.service.d.ts +1 -1
- package/dist/stopwatch.service.d.ts +1 -1
- package/dist/time.service.d.ts +1 -2
- package/dist/time.service.js +1 -2
- package/dist/week.vo.d.ts +3 -3
- package/dist/week.vo.js +1 -1
- package/dist/z-score.service.d.ts +1 -1
- package/package.json +5 -5
- package/src/clock.vo.ts +2 -2
- package/src/date-range.vo.ts +1 -1
- package/src/day.vo.ts +3 -3
- package/src/filter.vo.ts +1 -1
- package/src/iban-mask.service.ts +1 -1
- package/src/mean.service.ts +1 -1
- package/src/min-max-scaler.service.ts +1 -1
- package/src/money.vo.ts +1 -1
- package/src/percentage.service.ts +1 -1
- package/src/population-standard-deviation.service.ts +1 -1
- package/src/rate-limiter.service.ts +1 -1
- package/src/revision.vo.ts +1 -1
- package/src/simple-linear-regression.service.ts +1 -1
- package/src/stopwatch.service.ts +1 -1
- package/src/time.service.ts +1 -3
- package/src/week.vo.ts +3 -3
- package/src/z-score.service.ts +1 -1
package/dist/clock.vo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Hour } from "./hour.vo";
|
|
2
|
-
import { Minute } from "./minute.vo";
|
|
1
|
+
import { type Hour } from "./hour.vo";
|
|
2
|
+
import type { Minute } from "./minute.vo";
|
|
3
3
|
export type ClockFormatter = (hour: Hour, minute: Minute) => string;
|
|
4
4
|
declare enum ClockFormatterEnum {
|
|
5
5
|
TWENTY_FOUR_HOURS = "TWENTY_FOUR_HOURS",
|
package/dist/date-range.vo.d.ts
CHANGED
package/dist/day.vo.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { DateRange } from "./date-range.vo";
|
|
2
|
-
import { DayIsoIdType } from "./day-iso-id.vo";
|
|
3
|
-
import { TimestampType } from "./timestamp.vo";
|
|
2
|
+
import { type DayIsoIdType } from "./day-iso-id.vo";
|
|
3
|
+
import { type TimestampType } from "./timestamp.vo";
|
|
4
4
|
export declare class Day extends DateRange {
|
|
5
5
|
private constructor();
|
|
6
6
|
toIsoId(): DayIsoIdType;
|
|
7
7
|
static fromTimestamp(timestamp: TimestampType): Day;
|
|
8
|
-
static fromNow(now
|
|
8
|
+
static fromNow(now: TimestampType): Day;
|
|
9
9
|
static fromIsoId(isoId: DayIsoIdType): Day;
|
|
10
10
|
}
|
package/dist/day.vo.js
CHANGED
|
@@ -15,7 +15,7 @@ export class Day extends DateRange {
|
|
|
15
15
|
const end = Timestamp.parse(endOfDay(timestamp).getTime());
|
|
16
16
|
return new Day(start, end);
|
|
17
17
|
}
|
|
18
|
-
static fromNow(now
|
|
18
|
+
static fromNow(now) {
|
|
19
19
|
return Day.fromTimestamp(now);
|
|
20
20
|
}
|
|
21
21
|
static fromIsoId(isoId) {
|
package/dist/filter.vo.d.ts
CHANGED
package/dist/mean.service.d.ts
CHANGED
package/dist/money.vo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
-
import { RoundingStrategy } from "./rounding.service";
|
|
2
|
+
import { type RoundingStrategy } from "./rounding.service";
|
|
3
3
|
export declare const MoneyAmount: z.core.$ZodBranded<z.ZodNumber, "MoneyAmount">;
|
|
4
4
|
export type MoneyAmountType = z.infer<typeof MoneyAmount>;
|
|
5
5
|
export declare const MoneyMultiplicationFactor: z.core.$ZodBranded<z.ZodNumber, "MoneyMultiplicationFactor">;
|
package/dist/revision.vo.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
-
import { ETag, WeakETag } from "./etags.vo";
|
|
2
|
+
import type { ETag, WeakETag } from "./etags.vo";
|
|
3
3
|
export declare const RevisionValue: z.ZodNumber;
|
|
4
4
|
export type RevisionValueType = z.infer<typeof RevisionValue>;
|
|
5
5
|
export declare class Revision {
|
package/dist/time.service.d.ts
CHANGED
|
@@ -24,8 +24,7 @@ export declare class Time {
|
|
|
24
24
|
static Minutes(value: number): TimeResultInterface;
|
|
25
25
|
static Seconds(value: number): TimeResultInterface;
|
|
26
26
|
static Ms(value: number): TimeResultInterface;
|
|
27
|
-
static Now(now
|
|
28
|
-
value: TimestampType;
|
|
27
|
+
static Now(now: TimestampType): {
|
|
29
28
|
Minus(time: TimeResultInterface): TimeResultInterface;
|
|
30
29
|
Add(time: TimeResultInterface): TimeResultInterface;
|
|
31
30
|
};
|
package/dist/time.service.js
CHANGED
|
@@ -36,9 +36,8 @@ export class Time {
|
|
|
36
36
|
static Ms(value) {
|
|
37
37
|
return new TimeResult(rounding.round(value / 1000 / 60 / 60 / 24), rounding.round(value / 1000 / 60 / 60), rounding.round(value / 1000 / 60), rounding.round(value / 1000), value);
|
|
38
38
|
}
|
|
39
|
-
static Now(now
|
|
39
|
+
static Now(now) {
|
|
40
40
|
return {
|
|
41
|
-
value: now,
|
|
42
41
|
Minus(time) {
|
|
43
42
|
return Time.Ms(now - time.ms);
|
|
44
43
|
},
|
package/dist/week.vo.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { DateRange } from "./date-range.vo";
|
|
2
|
-
import { TimestampType } from "./timestamp.vo";
|
|
3
|
-
import { WeekIsoIdType } from "./week-iso-id.vo";
|
|
2
|
+
import { type TimestampType } from "./timestamp.vo";
|
|
3
|
+
import { type WeekIsoIdType } from "./week-iso-id.vo";
|
|
4
4
|
export declare class Week extends DateRange {
|
|
5
5
|
toIsoId(): WeekIsoIdType;
|
|
6
6
|
static fromTimestamp(timestamp: TimestampType): Week;
|
|
7
|
-
static fromNow(now
|
|
7
|
+
static fromNow(now: TimestampType): Week;
|
|
8
8
|
static fromIsoId(isoId: WeekIsoIdType): Week;
|
|
9
9
|
}
|
package/dist/week.vo.js
CHANGED
|
@@ -13,7 +13,7 @@ export class Week extends DateRange {
|
|
|
13
13
|
const end = Timestamp.parse(endOfISOWeek(timestamp).getTime());
|
|
14
14
|
return new Week(start, end);
|
|
15
15
|
}
|
|
16
|
-
static fromNow(now
|
|
16
|
+
static fromNow(now) {
|
|
17
17
|
return Week.fromTimestamp(now);
|
|
18
18
|
}
|
|
19
19
|
static fromIsoId(isoId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bgord/tools",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Bartosz Gordon",
|
|
@@ -25,21 +25,21 @@
|
|
|
25
25
|
"@commitlint/cli": "19.8.1",
|
|
26
26
|
"@commitlint/config-conventional": "19.8.1",
|
|
27
27
|
"@types/bun": "1.2.21",
|
|
28
|
-
"@types/mime-types": "
|
|
28
|
+
"@types/mime-types": "3.0.1",
|
|
29
29
|
"cspell": "9.2.0",
|
|
30
30
|
"knip": "5.63.0",
|
|
31
31
|
"lefthook": "1.12.3",
|
|
32
32
|
"only-allow": "1.2.1",
|
|
33
33
|
"shellcheck": "4.1.0",
|
|
34
34
|
"typescript": "5.9.2",
|
|
35
|
-
"zod": "4.1.
|
|
35
|
+
"zod": "4.1.5"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"date-fns": "4.1.0",
|
|
39
|
-
"mime-types": "
|
|
39
|
+
"mime-types": "3.0.1"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"zod": "4.1.
|
|
42
|
+
"zod": "4.1.5"
|
|
43
43
|
},
|
|
44
44
|
"sideEffects": false
|
|
45
45
|
}
|
package/src/clock.vo.ts
CHANGED
package/src/date-range.vo.ts
CHANGED
package/src/day.vo.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { endOfDay, startOfDay } from "date-fns";
|
|
2
2
|
import { DateRange } from "./date-range.vo";
|
|
3
|
-
import { DayIsoId, DayIsoIdType } from "./day-iso-id.vo";
|
|
3
|
+
import { DayIsoId, type DayIsoIdType } from "./day-iso-id.vo";
|
|
4
4
|
import { Time } from "./time.service";
|
|
5
|
-
import { Timestamp, TimestampType } from "./timestamp.vo";
|
|
5
|
+
import { Timestamp, type TimestampType } from "./timestamp.vo";
|
|
6
6
|
|
|
7
7
|
export class Day extends DateRange {
|
|
8
8
|
private constructor(start: TimestampType, end: TimestampType) {
|
|
@@ -19,7 +19,7 @@ export class Day extends DateRange {
|
|
|
19
19
|
return new Day(start, end);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
static fromNow(now: TimestampType
|
|
22
|
+
static fromNow(now: TimestampType): Day {
|
|
23
23
|
return Day.fromTimestamp(now);
|
|
24
24
|
}
|
|
25
25
|
|
package/src/filter.vo.ts
CHANGED
package/src/iban-mask.service.ts
CHANGED
package/src/mean.service.ts
CHANGED
package/src/money.vo.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Mean } from "./mean.service";
|
|
2
|
-
import { RoundingStrategy, RoundToDecimal } from "./rounding.service";
|
|
2
|
+
import { type RoundingStrategy, RoundToDecimal } from "./rounding.service";
|
|
3
3
|
import { Sum } from "./sum.service";
|
|
4
4
|
|
|
5
5
|
export class PopulationStandardDeviation {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TimeResult } from "./time.service";
|
|
2
|
-
import { Timestamp, TimestampType } from "./timestamp.vo";
|
|
2
|
+
import { Timestamp, type TimestampType } from "./timestamp.vo";
|
|
3
3
|
import type { Falsy } from "./ts-utils";
|
|
4
4
|
|
|
5
5
|
type RateLimiterOptionsType = Pick<TimeResult, "ms">;
|
package/src/revision.vo.ts
CHANGED
package/src/stopwatch.service.ts
CHANGED
package/src/time.service.ts
CHANGED
package/src/week.vo.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { endOfISOWeek, getISOWeek, getISOWeekYear, setISOWeek, startOfISOWeek } from "date-fns";
|
|
2
2
|
import { DateRange } from "./date-range.vo";
|
|
3
|
-
import { Timestamp, TimestampType } from "./timestamp.vo";
|
|
4
|
-
import { WeekIsoId, WeekIsoIdType } from "./week-iso-id.vo";
|
|
3
|
+
import { Timestamp, type TimestampType } from "./timestamp.vo";
|
|
4
|
+
import { WeekIsoId, type WeekIsoIdType } from "./week-iso-id.vo";
|
|
5
5
|
|
|
6
6
|
export class Week extends DateRange {
|
|
7
7
|
toIsoId(): WeekIsoIdType {
|
|
@@ -18,7 +18,7 @@ export class Week extends DateRange {
|
|
|
18
18
|
return new Week(start, end);
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
static fromNow(now: TimestampType
|
|
21
|
+
static fromNow(now: TimestampType): Week {
|
|
22
22
|
return Week.fromTimestamp(now);
|
|
23
23
|
}
|
|
24
24
|
|
package/src/z-score.service.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Mean } from "./mean.service";
|
|
2
2
|
import { PopulationStandardDeviation } from "./population-standard-deviation.service";
|
|
3
|
-
import { RoundingStrategy, RoundToDecimal } from "./rounding.service";
|
|
3
|
+
import { type RoundingStrategy, RoundToDecimal } from "./rounding.service";
|
|
4
4
|
|
|
5
5
|
export class ZScore {
|
|
6
6
|
private readonly mean: number;
|