@bgord/tools 0.17.2 → 1.0.1
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/age-years.vo.d.ts +11 -0
- package/dist/age-years.vo.js +9 -0
- package/dist/age.vo.d.ts +11 -16
- package/dist/age.vo.js +20 -31
- package/dist/api-key.vo.d.ts +3 -1
- package/dist/api-key.vo.js +10 -5
- package/dist/basename.vo.d.ts +9 -9
- package/dist/basename.vo.js +22 -22
- package/dist/clock.vo.d.ts +10 -4
- package/dist/clock.vo.js +12 -14
- package/dist/date-calculator.service.d.ts +2 -1
- package/dist/date-formatter.service.d.ts +3 -4
- package/dist/date-range.vo.d.ts +7 -1
- package/dist/date-range.vo.js +5 -2
- package/dist/day-iso-id.vo.d.ts +5 -2
- package/dist/day-iso-id.vo.js +11 -7
- package/dist/day.vo.d.ts +4 -3
- package/dist/day.vo.js +18 -16
- package/dist/directory-path-absolute.vo.d.ts +10 -6
- package/dist/directory-path-absolute.vo.js +19 -17
- package/dist/directory-path-relative.vo.d.ts +10 -7
- package/dist/directory-path-relative.vo.js +18 -17
- package/dist/division-factor.vo.d.ts +7 -0
- package/dist/division-factor.vo.js +9 -0
- package/dist/duration-ms.vo.d.ts +6 -0
- package/dist/duration-ms.vo.js +3 -0
- package/dist/duration.service.d.ts +2 -14
- package/dist/duration.service.js +16 -35
- package/dist/email-mask.service.d.ts +1 -6
- package/dist/email-mask.service.js +6 -8
- package/dist/etags.vo.d.ts +4 -3
- package/dist/etags.vo.js +3 -3
- package/dist/extension.vo.d.ts +6 -4
- package/dist/extension.vo.js +15 -10
- package/dist/feature-flag-value.vo.d.ts +10 -0
- package/dist/feature-flag-value.vo.js +8 -0
- package/dist/feature-flag.vo.d.ts +1 -7
- package/dist/feature-flag.vo.js +1 -7
- package/dist/file-path-absolute-schema.vo.d.ts +10 -7
- package/dist/file-path-absolute-schema.vo.js +17 -17
- package/dist/file-path-relative-schema.vo.d.ts +10 -7
- package/dist/file-path-relative-schema.vo.js +14 -12
- package/dist/file-path.vo.d.ts +4 -4
- package/dist/file-path.vo.js +8 -8
- package/dist/filename-from-string.vo.d.ts +4 -2
- package/dist/filename-from-string.vo.js +10 -8
- package/dist/filename-suffix.vo.d.ts +7 -3
- package/dist/filename-suffix.vo.js +13 -7
- package/dist/filename.vo.d.ts +2 -0
- package/dist/filename.vo.js +8 -2
- package/dist/height-milimiters.vo.d.ts +6 -0
- package/dist/height-milimiters.vo.js +10 -0
- package/dist/height.vo.d.ts +3 -20
- package/dist/height.vo.js +11 -62
- package/dist/hour-format.service.js +1 -1
- package/dist/hour-schema.vo.d.ts +7 -0
- package/dist/hour-schema.vo.js +8 -0
- package/dist/hour.vo.d.ts +4 -3
- package/dist/hour.vo.js +8 -8
- package/dist/iban-mask.service.d.ts +1 -3
- package/dist/iban-mask.service.js +2 -2
- package/dist/iban-schema.vo.d.ts +7 -0
- package/dist/iban-schema.vo.js +10 -0
- package/dist/iban.vo.d.ts +4 -10
- package/dist/iban.vo.js +6 -13
- package/dist/image.vo.d.ts +6 -4
- package/dist/image.vo.js +13 -12
- package/dist/index.d.ts +24 -2
- package/dist/index.js +24 -2
- package/dist/language.vo.d.ts +2 -1
- package/dist/language.vo.js +6 -4
- package/dist/linear-regression.service.d.ts +27 -0
- package/dist/{simple-linear-regression.service.js → linear-regression.service.js} +17 -15
- package/dist/mean.service.d.ts +3 -1
- package/dist/mean.service.js +3 -4
- package/dist/mime-types.vo.d.ts +1 -2
- package/dist/mime-value.vo.d.ts +9 -0
- package/dist/mime-value.vo.js +9 -0
- package/dist/mime.vo.d.ts +11 -17
- package/dist/mime.vo.js +10 -27
- package/dist/min-max-scaler.service.d.ts +7 -5
- package/dist/min-max-scaler.service.js +12 -10
- package/dist/minute-schema.vo.d.ts +7 -0
- package/dist/minute-schema.vo.js +8 -0
- package/dist/minute.vo.d.ts +4 -3
- package/dist/minute.vo.js +8 -8
- package/dist/money-amount.vo.d.ts +7 -0
- package/dist/money-amount.vo.js +7 -0
- package/dist/money.vo.d.ts +9 -18
- package/dist/money.vo.js +14 -27
- package/dist/month-iso-id.vo.d.ts +4 -2
- package/dist/month-iso-id.vo.js +13 -7
- package/dist/month.vo.d.ts +4 -3
- package/dist/month.vo.js +21 -21
- package/dist/multiplication-factor.vo.d.ts +7 -0
- package/dist/multiplication-factor.vo.js +9 -0
- package/dist/object-key.vo.d.ts +9 -6
- package/dist/object-key.vo.js +20 -19
- package/dist/outlier-detector.service.d.ts +3 -1
- package/dist/outlier-detector.service.js +2 -2
- package/dist/package-version-schema.vo.d.ts +11 -0
- package/dist/package-version-schema.vo.js +15 -0
- package/dist/package-version.vo.d.ts +11 -20
- package/dist/package-version.vo.js +11 -20
- package/dist/pagination-page.vo.d.ts +6 -0
- package/dist/pagination-page.vo.js +7 -0
- package/dist/pagination-skip.vo.d.ts +7 -0
- package/dist/pagination-skip.vo.js +9 -0
- package/dist/pagination-take.vo.d.ts +7 -0
- package/dist/pagination-take.vo.js +9 -0
- package/dist/pagination.service.d.ts +3 -8
- package/dist/pagination.service.js +5 -12
- package/dist/percentage.service.d.ts +3 -1
- package/dist/percentage.service.js +2 -2
- package/dist/population-standard-deviation.service.d.ts +3 -1
- package/dist/population-standard-deviation.service.js +5 -4
- package/dist/quarter-iso-id.vo.d.ts +3 -2
- package/dist/quarter-iso-id.vo.js +7 -9
- package/dist/quarter.vo.d.ts +2 -1
- package/dist/quarter.vo.js +10 -7
- package/dist/random.service.d.ts +3 -4
- package/dist/random.service.js +5 -11
- package/dist/rate-limiter.service.d.ts +2 -2
- package/dist/rate-limiter.service.js +8 -8
- package/dist/reordering-item-position-value.vo.d.ts +6 -0
- package/dist/reordering-item-position-value.vo.js +6 -0
- package/dist/reordering.service.d.ts +7 -23
- package/dist/reordering.service.js +15 -24
- package/dist/revision-value.vo.d.ts +7 -0
- package/dist/revision-value.vo.js +6 -0
- package/dist/revision.vo.d.ts +6 -13
- package/dist/revision.vo.js +10 -22
- package/dist/rounding.adapter.d.ts +7 -2
- package/dist/rounding.adapter.js +13 -5
- package/dist/size-bytes.vo.d.ts +6 -0
- package/dist/size-bytes.vo.js +7 -0
- package/dist/size.vo.d.ts +15 -15
- package/dist/size.vo.js +41 -51
- package/dist/stopwatch.service.d.ts +3 -1
- package/dist/stopwatch.service.js +2 -2
- package/dist/sum.service.js +8 -8
- package/dist/thousands-separator.service.js +4 -1
- package/dist/time.service.d.ts +8 -0
- package/dist/time.service.js +13 -0
- package/dist/timestamp.vo.d.ts +1 -1
- package/dist/timestamp.vo.js +4 -5
- package/dist/timezone.vo.d.ts +4 -1
- package/dist/timezone.vo.js +12 -6
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/week-iso-id.vo.d.ts +4 -2
- package/dist/week-iso-id.vo.js +15 -9
- package/dist/week.vo.d.ts +4 -3
- package/dist/week.vo.js +21 -22
- package/dist/weekday.vo.d.ts +1 -1
- package/dist/weekday.vo.js +6 -8
- package/dist/weight-grams.vo.d.ts +7 -0
- package/dist/weight-grams.vo.js +7 -0
- package/dist/weight.vo.d.ts +12 -35
- package/dist/weight.vo.js +23 -72
- package/dist/year-iso-id.vo.d.ts +3 -2
- package/dist/year-iso-id.vo.js +6 -4
- package/dist/year.vo.d.ts +5 -6
- package/dist/year.vo.js +21 -26
- package/dist/z-score.service.d.ts +3 -1
- package/dist/z-score.service.js +2 -2
- package/package.json +4 -4
- package/readme.md +21 -2
- package/src/age-years.vo.ts +14 -0
- package/src/age.vo.ts +22 -35
- package/src/api-key.vo.ts +11 -5
- package/src/basename.vo.ts +24 -22
- package/src/clock.vo.ts +16 -17
- package/src/date-calculator.service.ts +2 -1
- package/src/date-formatter.service.ts +4 -5
- package/src/date-range.vo.ts +6 -2
- package/src/day-iso-id.vo.ts +12 -8
- package/src/day.vo.ts +27 -24
- package/src/directory-path-absolute.vo.ts +23 -18
- package/src/directory-path-relative.vo.ts +21 -18
- package/src/division-factor.vo.ts +13 -0
- package/src/duration-ms.vo.ts +7 -0
- package/src/duration.service.ts +16 -40
- package/src/email-mask.service.ts +7 -15
- package/src/etags.vo.ts +4 -5
- package/src/extension.vo.ts +17 -10
- package/src/feature-flag-value.vo.ts +12 -0
- package/src/feature-flag.vo.ts +1 -9
- package/src/file-path-absolute-schema.vo.ts +18 -17
- package/src/file-path-relative-schema.vo.ts +15 -12
- package/src/file-path.vo.ts +8 -8
- package/src/filename-from-string.vo.ts +12 -9
- package/src/filename-suffix.vo.ts +14 -7
- package/src/filename.vo.ts +11 -2
- package/src/height-milimiters.vo.ts +12 -0
- package/src/height.vo.ts +12 -83
- package/src/hour-format.service.ts +2 -1
- package/src/hour-schema.vo.ts +12 -0
- package/src/hour.vo.ts +12 -12
- package/src/iban-mask.service.ts +3 -5
- package/src/iban-schema.vo.ts +15 -0
- package/src/iban.vo.ts +9 -22
- package/src/image.vo.ts +14 -12
- package/src/index.ts +24 -2
- package/src/language.vo.ts +7 -4
- package/src/linear-regression.service.ts +71 -0
- package/src/mean.service.ts +3 -5
- package/src/mime-types.vo.ts +1 -3
- package/src/mime-value.vo.ts +12 -0
- package/src/mime.vo.ts +12 -33
- package/src/min-max-scaler.service.ts +13 -11
- package/src/minute-schema.vo.ts +12 -0
- package/src/minute.vo.ts +12 -12
- package/src/money-amount.vo.ts +11 -0
- package/src/money.vo.ts +20 -38
- package/src/month-iso-id.vo.ts +14 -7
- package/src/month.vo.ts +25 -24
- package/src/multiplication-factor.vo.ts +13 -0
- package/src/object-key.vo.ts +25 -21
- package/src/outlier-detector.service.ts +2 -2
- package/src/package-version-schema.vo.ts +21 -0
- package/src/package-version.vo.ts +17 -33
- package/src/pagination-page.vo.ts +11 -0
- package/src/pagination-skip.vo.ts +13 -0
- package/src/pagination-take.vo.ts +13 -0
- package/src/pagination.service.ts +5 -22
- package/src/percentage.service.ts +2 -2
- package/src/population-standard-deviation.service.ts +5 -4
- package/src/quarter-iso-id.vo.ts +7 -10
- package/src/quarter.vo.ts +14 -9
- package/src/random.service.ts +6 -9
- package/src/rate-limiter.service.ts +9 -8
- package/src/reordering-item-position-value.vo.ts +10 -0
- package/src/reordering.service.ts +19 -28
- package/src/revision-value.vo.ts +10 -0
- package/src/revision.vo.ts +10 -25
- package/src/rounding.adapter.ts +16 -3
- package/src/size-bytes.vo.ts +11 -0
- package/src/size.vo.ts +43 -54
- package/src/stopwatch.service.ts +3 -3
- package/src/sum.service.ts +8 -8
- package/src/thousands-separator.service.ts +4 -1
- package/src/time.service.ts +15 -0
- package/src/timestamp.vo.ts +4 -5
- package/src/timezone.vo.ts +12 -6
- package/src/week-iso-id.vo.ts +16 -12
- package/src/week.vo.ts +26 -28
- package/src/weekday.vo.ts +6 -9
- package/src/weight-grams.vo.ts +11 -0
- package/src/weight.vo.ts +28 -85
- package/src/year-iso-id.vo.ts +7 -4
- package/src/year.vo.ts +27 -33
- package/src/z-score.service.ts +2 -2
- package/dist/simple-linear-regression.service.d.ts +0 -25
- package/dist/streak-calculator.service.d.ts +0 -13
- package/dist/streak-calculator.service.js +0 -22
- package/src/simple-linear-regression.service.ts +0 -69
- package/src/streak-calculator.service.ts +0 -32
package/dist/height.vo.d.ts
CHANGED
|
@@ -1,36 +1,19 @@
|
|
|
1
1
|
import type { RoundingPort } from "./rounding.port";
|
|
2
|
-
export declare enum HeightUnit {
|
|
3
|
-
cm = "cm",
|
|
4
|
-
ft_in = "ft_in"
|
|
5
|
-
}
|
|
6
2
|
export declare class Height {
|
|
7
3
|
private readonly millimeters;
|
|
8
4
|
private static readonly MILLIMETERS_PER_CENTIMETER;
|
|
9
|
-
private static readonly MILLIMETERS_PER_INCH;
|
|
10
|
-
private static readonly INCHES_PER_FOOT;
|
|
11
5
|
private constructor();
|
|
12
6
|
static fromCentimeters(centimeters: number, rounding?: RoundingPort): Height;
|
|
13
|
-
static
|
|
14
|
-
static fromMillimeters(millimeters: number, rounding?: RoundingPort): Height;
|
|
7
|
+
static fromMillimeters(millimeters: number): Height;
|
|
15
8
|
static zero(): Height;
|
|
16
9
|
get(): number;
|
|
17
10
|
toMillimeters(): number;
|
|
18
11
|
toCentimeters(rounding?: RoundingPort): number;
|
|
19
|
-
|
|
20
|
-
feet: number;
|
|
21
|
-
inches: number;
|
|
22
|
-
};
|
|
23
|
-
format(unit: HeightUnit, rounding?: RoundingPort): string;
|
|
12
|
+
format(rounding?: RoundingPort): string;
|
|
24
13
|
toString(): string;
|
|
25
14
|
equals(another: Height): boolean;
|
|
26
|
-
compare(another: Height): -1 | 0 | 1;
|
|
27
15
|
greaterThan(another: Height): boolean;
|
|
28
16
|
lessThan(another: Height): boolean;
|
|
29
17
|
isZero(): boolean;
|
|
30
|
-
toJSON():
|
|
31
|
-
mm: number;
|
|
32
|
-
};
|
|
33
|
-
static fromJSON(input: {
|
|
34
|
-
mm: number;
|
|
35
|
-
}): Height;
|
|
18
|
+
toJSON(): number;
|
|
36
19
|
}
|
package/dist/height.vo.js
CHANGED
|
@@ -1,47 +1,17 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { HeightMillimeters } from "./height-milimiters.vo";
|
|
2
2
|
import { RoundToDecimal, RoundToNearest } from "./rounding.adapter";
|
|
3
|
-
const NonFiniteNumberError = { error: "number.non_finite" };
|
|
4
|
-
const NumberNegativeError = { error: "number.negative" };
|
|
5
|
-
const MillimetersIntegerNonNegativeError = { error: "millimeters.integer_non_negative" };
|
|
6
|
-
const IntegerNonNegativeError = { error: "integer.non_negative" };
|
|
7
|
-
const HeightFiniteNumber = z.number(NonFiniteNumberError).refine(Number.isFinite, NonFiniteNumberError);
|
|
8
|
-
const HeightNonNegativeQuantity = HeightFiniteNumber.min(0, NumberNegativeError);
|
|
9
|
-
const HeightCanonicalMillimeters = HeightFiniteNumber.int(MillimetersIntegerNonNegativeError).min(0, MillimetersIntegerNonNegativeError);
|
|
10
|
-
const HeightRoundedWholeInches = HeightFiniteNumber.int(IntegerNonNegativeError).min(0, IntegerNonNegativeError);
|
|
11
|
-
export var HeightUnit;
|
|
12
|
-
(function (HeightUnit) {
|
|
13
|
-
HeightUnit["cm"] = "cm";
|
|
14
|
-
HeightUnit["ft_in"] = "ft_in";
|
|
15
|
-
})(HeightUnit || (HeightUnit = {}));
|
|
16
3
|
export class Height {
|
|
17
4
|
millimeters;
|
|
18
5
|
static MILLIMETERS_PER_CENTIMETER = 10;
|
|
19
|
-
static MILLIMETERS_PER_INCH = 25.4;
|
|
20
|
-
static INCHES_PER_FOOT = 12;
|
|
21
6
|
constructor(millimeters) {
|
|
22
7
|
this.millimeters = millimeters;
|
|
23
8
|
}
|
|
24
9
|
static fromCentimeters(centimeters, rounding = new RoundToNearest()) {
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
const millimetersRounded = rounding.round(millimetersFloat);
|
|
28
|
-
const validatedMillimeters = HeightCanonicalMillimeters.parse(millimetersRounded);
|
|
29
|
-
return new Height(validatedMillimeters);
|
|
10
|
+
const millimeters = rounding.round(centimeters * Height.MILLIMETERS_PER_CENTIMETER);
|
|
11
|
+
return new Height(HeightMillimeters.parse(millimeters));
|
|
30
12
|
}
|
|
31
|
-
static
|
|
32
|
-
|
|
33
|
-
const validatedInches = HeightNonNegativeQuantity.parse(inches);
|
|
34
|
-
const totalInches = validatedFeet * Height.INCHES_PER_FOOT + validatedInches;
|
|
35
|
-
const millimetersFloat = totalInches * Height.MILLIMETERS_PER_INCH;
|
|
36
|
-
const millimetersRounded = rounding.round(millimetersFloat);
|
|
37
|
-
const validatedMillimeters = HeightCanonicalMillimeters.parse(millimetersRounded);
|
|
38
|
-
return new Height(validatedMillimeters);
|
|
39
|
-
}
|
|
40
|
-
static fromMillimeters(millimeters, rounding = new RoundToNearest()) {
|
|
41
|
-
const validatedMillimetersInput = HeightNonNegativeQuantity.parse(millimeters);
|
|
42
|
-
const millimetersRounded = rounding.round(validatedMillimetersInput);
|
|
43
|
-
const validatedMillimeters = HeightCanonicalMillimeters.parse(millimetersRounded);
|
|
44
|
-
return new Height(validatedMillimeters);
|
|
13
|
+
static fromMillimeters(millimeters) {
|
|
14
|
+
return new Height(HeightMillimeters.parse(millimeters));
|
|
45
15
|
}
|
|
46
16
|
static zero() {
|
|
47
17
|
return new Height(0);
|
|
@@ -58,35 +28,17 @@ export class Height {
|
|
|
58
28
|
return rounding.round(centimeters);
|
|
59
29
|
return centimeters;
|
|
60
30
|
}
|
|
61
|
-
|
|
62
|
-
const
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const feet = Math.floor(totalWholeInches / Height.INCHES_PER_FOOT);
|
|
66
|
-
const inches = totalWholeInches % Height.INCHES_PER_FOOT;
|
|
67
|
-
return { feet, inches };
|
|
68
|
-
}
|
|
69
|
-
format(unit, rounding) {
|
|
70
|
-
if (unit === HeightUnit.cm) {
|
|
71
|
-
const chosen = rounding ?? new RoundToDecimal(1);
|
|
72
|
-
const value = this.toCentimeters(chosen);
|
|
73
|
-
return `${value} cm`;
|
|
74
|
-
}
|
|
75
|
-
const chosen = rounding ?? new RoundToNearest();
|
|
76
|
-
const parts = this.toFeetInches(chosen);
|
|
77
|
-
return `${parts.feet}′${parts.inches}″`;
|
|
31
|
+
format(rounding) {
|
|
32
|
+
const chosen = rounding ?? new RoundToDecimal(1);
|
|
33
|
+
const value = this.toCentimeters(chosen);
|
|
34
|
+
return `${value} cm`;
|
|
78
35
|
}
|
|
79
36
|
toString() {
|
|
80
|
-
return this.format(
|
|
37
|
+
return this.format(new RoundToDecimal(1));
|
|
81
38
|
}
|
|
82
39
|
equals(another) {
|
|
83
40
|
return this.millimeters === another.millimeters;
|
|
84
41
|
}
|
|
85
|
-
compare(another) {
|
|
86
|
-
if (this.equals(another))
|
|
87
|
-
return 0;
|
|
88
|
-
return this.millimeters < another.millimeters ? -1 : 1;
|
|
89
|
-
}
|
|
90
42
|
greaterThan(another) {
|
|
91
43
|
return this.millimeters > another.millimeters;
|
|
92
44
|
}
|
|
@@ -97,9 +49,6 @@ export class Height {
|
|
|
97
49
|
return this.millimeters === 0;
|
|
98
50
|
}
|
|
99
51
|
toJSON() {
|
|
100
|
-
return
|
|
101
|
-
}
|
|
102
|
-
static fromJSON(input) {
|
|
103
|
-
return Height.fromMillimeters(input.mm);
|
|
52
|
+
return this.millimeters;
|
|
104
53
|
}
|
|
105
54
|
}
|
|
@@ -10,8 +10,8 @@ export const HourFormatters = {
|
|
|
10
10
|
TWENTY_FOUR_HOURS: (value) => value.toString().padStart(2, "0"),
|
|
11
11
|
TWENTY_FOUR_HOURS_WO_PADDING: (value) => value.toString(),
|
|
12
12
|
AM_PM: (value) => {
|
|
13
|
-
const twelveHourValue = value % 12 || 12;
|
|
14
13
|
const suffix = value < 12 ? "a.m." : "p.m.";
|
|
14
|
+
const twelveHourValue = value % 12 || 12;
|
|
15
15
|
return `${twelveHourValue} ${suffix}`;
|
|
16
16
|
},
|
|
17
17
|
TWELVE_HOURS: (value) => (value % 12 || 12).toString().padStart(2, "0"),
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
export const HourSchemaError = { Type: "hour.schema.error", Invalid: "hour.schema.invalid" };
|
|
3
|
+
export const HourSchema = z
|
|
4
|
+
.number(HourSchemaError.Type)
|
|
5
|
+
.int(HourSchemaError.Type)
|
|
6
|
+
.gte(0, HourSchemaError.Invalid)
|
|
7
|
+
.lte(23, HourSchemaError.Invalid)
|
|
8
|
+
.brand("HourSchema");
|
package/dist/hour.vo.d.ts
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { type HourFormatter } from "./hour-format.service";
|
|
2
|
+
import { type HourSchemaType } from "./hour-schema.vo";
|
|
2
3
|
import type { TimestampType } from "./timestamp.vo";
|
|
3
|
-
export declare const HourValueError: "invalid.hour";
|
|
4
4
|
export declare class Hour {
|
|
5
5
|
private readonly value;
|
|
6
6
|
static readonly ZERO: Hour;
|
|
7
7
|
static readonly MAX: Hour;
|
|
8
8
|
constructor(candidate: number);
|
|
9
9
|
static fromEpochMs(timestamp: TimestampType): Hour;
|
|
10
|
-
get():
|
|
11
|
-
toString(): string;
|
|
10
|
+
get(): HourSchemaType;
|
|
12
11
|
format(formatter: HourFormatter): string;
|
|
13
12
|
equals(another: Hour): boolean;
|
|
14
13
|
isAfter(another: Hour): boolean;
|
|
15
14
|
isBefore(another: Hour): boolean;
|
|
16
15
|
static list(): readonly Hour[];
|
|
16
|
+
toString(): string;
|
|
17
|
+
toJSON(): number;
|
|
17
18
|
}
|
package/dist/hour.vo.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { HourFormatters } from "./hour-format.service";
|
|
2
|
-
|
|
2
|
+
import { HourSchema } from "./hour-schema.vo";
|
|
3
3
|
export class Hour {
|
|
4
4
|
value;
|
|
5
5
|
static ZERO = new Hour(0);
|
|
6
6
|
static MAX = new Hour(23);
|
|
7
7
|
constructor(candidate) {
|
|
8
|
-
|
|
9
|
-
throw new Error(HourValueError);
|
|
10
|
-
}
|
|
11
|
-
this.value = candidate;
|
|
8
|
+
this.value = HourSchema.parse(candidate);
|
|
12
9
|
}
|
|
13
10
|
static fromEpochMs(timestamp) {
|
|
14
11
|
return new Hour(new Date(timestamp).getUTCHours());
|
|
@@ -16,9 +13,6 @@ export class Hour {
|
|
|
16
13
|
get() {
|
|
17
14
|
return this.value;
|
|
18
15
|
}
|
|
19
|
-
toString() {
|
|
20
|
-
return HourFormatters.TWENTY_FOUR_HOURS(this.value);
|
|
21
|
-
}
|
|
22
16
|
format(formatter) {
|
|
23
17
|
return formatter(this.value);
|
|
24
18
|
}
|
|
@@ -34,4 +28,10 @@ export class Hour {
|
|
|
34
28
|
static list() {
|
|
35
29
|
return Array.from({ length: 24 }, (_, index) => new Hour(index));
|
|
36
30
|
}
|
|
31
|
+
toString() {
|
|
32
|
+
return HourFormatters.TWENTY_FOUR_HOURS(this.value);
|
|
33
|
+
}
|
|
34
|
+
toJSON() {
|
|
35
|
+
return this.value;
|
|
36
|
+
}
|
|
37
37
|
}
|
|
@@ -2,9 +2,9 @@ export class IbanMask {
|
|
|
2
2
|
static censor(iban) {
|
|
3
3
|
const value = iban.format();
|
|
4
4
|
const FIRST_SPACE_INDEX = 4;
|
|
5
|
-
const
|
|
5
|
+
const LAST_SPACE_INDEX = value.length - 5;
|
|
6
6
|
const start = value.slice(0, FIRST_SPACE_INDEX);
|
|
7
|
-
const middle = value.slice(FIRST_SPACE_INDEX + 1,
|
|
7
|
+
const middle = value.slice(FIRST_SPACE_INDEX + 1, LAST_SPACE_INDEX);
|
|
8
8
|
const end = value.slice(-4);
|
|
9
9
|
const maskedMiddle = middle.replace(/[A-Z0-9]/g, "*");
|
|
10
10
|
return `${start} ${maskedMiddle} ${end}`;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
export declare const IbanSchemaError: {
|
|
3
|
+
readonly Type: "iban.schema.type";
|
|
4
|
+
readonly Invalid: "iban.schema.invalid";
|
|
5
|
+
};
|
|
6
|
+
export declare const IbanSchema: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "IbanSchema">;
|
|
7
|
+
export type IbanSchemaType = z.infer<typeof IbanSchema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from "zod/v4";
|
|
2
|
+
export const IbanSchemaError = { Type: "iban.schema.type", Invalid: "iban.schema.invalid" };
|
|
3
|
+
// Two letters for country code, two digits, 11–30 uppercase letters or digits
|
|
4
|
+
const IBAN_CHARS_WHITELIST = /^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$/;
|
|
5
|
+
export const IbanSchema = z
|
|
6
|
+
.string(IbanSchemaError.Type)
|
|
7
|
+
.toUpperCase()
|
|
8
|
+
.transform((value) => value.replaceAll(" ", ""))
|
|
9
|
+
.refine((value) => IBAN_CHARS_WHITELIST.test(value), IbanSchemaError.Invalid)
|
|
10
|
+
.brand("IbanSchema");
|
package/dist/iban.vo.d.ts
CHANGED
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const IBANError: {
|
|
3
|
-
readonly error: "invalid.iban.format";
|
|
4
|
-
};
|
|
5
|
-
export declare const IBANValue: z.core.$ZodBranded<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>, "IBAN">;
|
|
6
|
-
export type IBANValueType = z.infer<typeof IBANValue>;
|
|
7
|
-
export type IBANCountryCode = string;
|
|
1
|
+
import { type IbanSchemaType } from "./iban-schema.vo";
|
|
8
2
|
export declare class IBAN {
|
|
9
3
|
private readonly value;
|
|
10
|
-
constructor(
|
|
11
|
-
toString():
|
|
4
|
+
constructor(candidate: string);
|
|
5
|
+
toString(): IbanSchemaType;
|
|
12
6
|
format(): string;
|
|
13
|
-
get countryCode():
|
|
7
|
+
get countryCode(): string;
|
|
14
8
|
equals(other: IBAN): boolean;
|
|
15
9
|
}
|
package/dist/iban.vo.js
CHANGED
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export const IBANError = { error: "invalid.iban.format" };
|
|
3
|
-
// 2-letter country code + 2 digits + 11–30 alphanumerics (overall 15–34 chars)
|
|
4
|
-
const IBAN_REGEX = /^[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}$/;
|
|
5
|
-
export const IBANValue = z
|
|
6
|
-
.string(IBANError)
|
|
7
|
-
.trim()
|
|
8
|
-
.toUpperCase()
|
|
9
|
-
.transform((val) => val.replace(/\s+/g, ""))
|
|
10
|
-
.refine((iban) => IBAN_REGEX.test(iban), IBANError)
|
|
11
|
-
.brand("IBAN");
|
|
1
|
+
import { IbanSchema } from "./iban-schema.vo";
|
|
12
2
|
export class IBAN {
|
|
13
3
|
value;
|
|
14
|
-
constructor(
|
|
15
|
-
this.value =
|
|
4
|
+
constructor(candidate) {
|
|
5
|
+
this.value = IbanSchema.parse(candidate);
|
|
16
6
|
}
|
|
17
7
|
toString() {
|
|
18
8
|
return this.value;
|
|
19
9
|
}
|
|
20
10
|
format() {
|
|
11
|
+
// (.{4}) - capture any four characters
|
|
12
|
+
// (?=.) - positive lookahead, at least one more character after the match
|
|
13
|
+
// "$1 " - replace each match with the group and a space
|
|
21
14
|
return this.value.replace(/(.{4})(?=.)/g, "$1 ");
|
|
22
15
|
}
|
|
23
16
|
get countryCode() {
|
package/dist/image.vo.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
2
|
export declare const ImageWidthError: {
|
|
3
|
-
readonly
|
|
3
|
+
readonly Type: "image.width.type";
|
|
4
|
+
readonly Length: "image.width.length";
|
|
4
5
|
};
|
|
5
6
|
export declare const ImageHeightError: {
|
|
6
|
-
readonly
|
|
7
|
+
readonly Type: "image.height.type";
|
|
8
|
+
readonly Length: "image.height.length";
|
|
7
9
|
};
|
|
8
|
-
export declare const ImageWidth: z.core.$ZodBranded<z.ZodNumber, "
|
|
10
|
+
export declare const ImageWidth: z.core.$ZodBranded<z.ZodNumber, "ImageWidth">;
|
|
9
11
|
export type ImageWidthType = z.infer<typeof ImageWidth>;
|
|
10
|
-
export declare const ImageHeight: z.core.$ZodBranded<z.ZodNumber, "
|
|
12
|
+
export declare const ImageHeight: z.core.$ZodBranded<z.ZodNumber, "ImageHeight">;
|
|
11
13
|
export type ImageHeightType = z.infer<typeof ImageHeight>;
|
package/dist/image.vo.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
-
export const ImageWidthError = {
|
|
3
|
-
export const ImageHeightError = {
|
|
2
|
+
export const ImageWidthError = { Type: "image.width.type", Length: "image.width.length" };
|
|
3
|
+
export const ImageHeightError = { Type: "image.height.type", Length: "image.height.length" };
|
|
4
|
+
const IMAGE_DIMENSIONS_CONSTRAINTS = { min: 1, max: 10_000 };
|
|
4
5
|
export const ImageWidth = z
|
|
5
|
-
.number(ImageWidthError)
|
|
6
|
-
.int(ImageWidthError)
|
|
7
|
-
.
|
|
8
|
-
.max(
|
|
9
|
-
.brand("
|
|
6
|
+
.number(ImageWidthError.Type)
|
|
7
|
+
.int(ImageWidthError.Type)
|
|
8
|
+
.min(IMAGE_DIMENSIONS_CONSTRAINTS.min, ImageWidthError.Length)
|
|
9
|
+
.max(IMAGE_DIMENSIONS_CONSTRAINTS.max, ImageWidthError.Length)
|
|
10
|
+
.brand("ImageWidth");
|
|
10
11
|
export const ImageHeight = z
|
|
11
|
-
.number(ImageHeightError)
|
|
12
|
-
.int(ImageHeightError)
|
|
13
|
-
.
|
|
14
|
-
.max(
|
|
15
|
-
.brand("
|
|
12
|
+
.number(ImageHeightError.Type)
|
|
13
|
+
.int(ImageHeightError.Type)
|
|
14
|
+
.min(IMAGE_DIMENSIONS_CONSTRAINTS.min, ImageHeightError.Length)
|
|
15
|
+
.max(IMAGE_DIMENSIONS_CONSTRAINTS.max, ImageHeightError.Length)
|
|
16
|
+
.brand("ImageHeight");
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from "./age.vo";
|
|
2
|
+
export * from "./age-years.vo";
|
|
2
3
|
export * from "./api-key.vo";
|
|
3
4
|
export * from "./basename.vo";
|
|
4
5
|
export * from "./clock.vo";
|
|
6
|
+
export * from "./clock-format.service";
|
|
5
7
|
export * from "./date-calculator.service";
|
|
6
8
|
export * from "./date-formatter.service";
|
|
7
9
|
export * from "./date-range.vo";
|
|
@@ -9,12 +11,15 @@ export * from "./day.vo";
|
|
|
9
11
|
export * from "./day-iso-id.vo";
|
|
10
12
|
export * from "./directory-path-absolute.vo";
|
|
11
13
|
export * from "./directory-path-relative.vo";
|
|
14
|
+
export * from "./division-factor.vo";
|
|
12
15
|
export * from "./dll.service";
|
|
13
16
|
export * from "./duration.service";
|
|
17
|
+
export * from "./duration-ms.vo";
|
|
14
18
|
export * from "./email-mask.service";
|
|
15
19
|
export * from "./etags.vo";
|
|
16
20
|
export * from "./extension.vo";
|
|
17
21
|
export * from "./feature-flag.vo";
|
|
22
|
+
export * from "./feature-flag-value.vo";
|
|
18
23
|
export * from "./file-path.vo";
|
|
19
24
|
export * from "./file-path-absolute-schema.vo";
|
|
20
25
|
export * from "./file-path-relative-schema.vo";
|
|
@@ -22,25 +27,39 @@ export * from "./filename.vo";
|
|
|
22
27
|
export * from "./filename-from-string.vo";
|
|
23
28
|
export * from "./filename-suffix.vo";
|
|
24
29
|
export * from "./height.vo";
|
|
30
|
+
export * from "./height-milimiters.vo";
|
|
25
31
|
export * from "./hour.vo";
|
|
32
|
+
export * from "./hour-format.service";
|
|
33
|
+
export * from "./hour-schema.vo";
|
|
26
34
|
export * from "./iban.vo";
|
|
27
35
|
export * from "./iban-mask.service";
|
|
36
|
+
export * from "./iban-schema.vo";
|
|
28
37
|
export * from "./image.vo";
|
|
38
|
+
export * from "./index";
|
|
29
39
|
export * from "./language.vo";
|
|
40
|
+
export * from "./linear-regression.service";
|
|
30
41
|
export * from "./mean.service";
|
|
31
42
|
export * from "./mime.vo";
|
|
32
43
|
export * from "./mime-types.vo";
|
|
44
|
+
export * from "./mime-value.vo";
|
|
33
45
|
export * from "./min-max-scaler.service";
|
|
34
46
|
export * from "./minute.vo";
|
|
47
|
+
export * from "./minute-schema.vo";
|
|
35
48
|
export * from "./money.vo";
|
|
49
|
+
export * from "./money-amount.vo";
|
|
36
50
|
export * from "./month.vo";
|
|
37
51
|
export * from "./month-iso-id.vo";
|
|
52
|
+
export * from "./multiplication-factor.vo";
|
|
38
53
|
export * from "./noop.service";
|
|
39
54
|
export * from "./notification-template.vo";
|
|
40
55
|
export * from "./object-key.vo";
|
|
41
56
|
export * from "./outlier-detector.service";
|
|
42
57
|
export * from "./package-version.vo";
|
|
58
|
+
export * from "./package-version-schema.vo";
|
|
43
59
|
export * from "./pagination.service";
|
|
60
|
+
export * from "./pagination-page.vo";
|
|
61
|
+
export * from "./pagination-skip.vo";
|
|
62
|
+
export * from "./pagination-take.vo";
|
|
44
63
|
export * from "./percentage.service";
|
|
45
64
|
export * from "./population-standard-deviation.service";
|
|
46
65
|
export * from "./quarter.vo";
|
|
@@ -49,15 +68,17 @@ export * from "./random.service";
|
|
|
49
68
|
export * from "./rate-limiter.service";
|
|
50
69
|
export * from "./relative-date.vo";
|
|
51
70
|
export * from "./reordering.service";
|
|
71
|
+
export * from "./reordering-item-position-value.vo";
|
|
52
72
|
export * from "./revision.vo";
|
|
73
|
+
export * from "./revision-value.vo";
|
|
53
74
|
export * from "./rounding.adapter";
|
|
54
75
|
export * from "./rounding.port";
|
|
55
|
-
export * from "./simple-linear-regression.service";
|
|
56
76
|
export * from "./size.vo";
|
|
77
|
+
export * from "./size-bytes.vo";
|
|
57
78
|
export * from "./stopwatch.service";
|
|
58
|
-
export * from "./streak-calculator.service";
|
|
59
79
|
export * from "./sum.service";
|
|
60
80
|
export * from "./thousands-separator.service";
|
|
81
|
+
export * from "./time.service";
|
|
61
82
|
export * from "./time-zone-offset-value.vo";
|
|
62
83
|
export * from "./timestamp.vo";
|
|
63
84
|
export * from "./timezone.vo";
|
|
@@ -67,6 +88,7 @@ export * from "./week.vo";
|
|
|
67
88
|
export * from "./week-iso-id.vo";
|
|
68
89
|
export * from "./weekday.vo";
|
|
69
90
|
export * from "./weight.vo";
|
|
91
|
+
export * from "./weight-grams.vo";
|
|
70
92
|
export * from "./year.vo";
|
|
71
93
|
export * from "./year-iso-id.vo";
|
|
72
94
|
export * from "./z-score.service";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export * from "./age.vo";
|
|
2
|
+
export * from "./age-years.vo";
|
|
2
3
|
export * from "./api-key.vo";
|
|
3
4
|
export * from "./basename.vo";
|
|
4
5
|
export * from "./clock.vo";
|
|
6
|
+
export * from "./clock-format.service";
|
|
5
7
|
export * from "./date-calculator.service";
|
|
6
8
|
export * from "./date-formatter.service";
|
|
7
9
|
export * from "./date-range.vo";
|
|
@@ -9,12 +11,15 @@ export * from "./day.vo";
|
|
|
9
11
|
export * from "./day-iso-id.vo";
|
|
10
12
|
export * from "./directory-path-absolute.vo";
|
|
11
13
|
export * from "./directory-path-relative.vo";
|
|
14
|
+
export * from "./division-factor.vo";
|
|
12
15
|
export * from "./dll.service";
|
|
13
16
|
export * from "./duration.service";
|
|
17
|
+
export * from "./duration-ms.vo";
|
|
14
18
|
export * from "./email-mask.service";
|
|
15
19
|
export * from "./etags.vo";
|
|
16
20
|
export * from "./extension.vo";
|
|
17
21
|
export * from "./feature-flag.vo";
|
|
22
|
+
export * from "./feature-flag-value.vo";
|
|
18
23
|
export * from "./file-path.vo";
|
|
19
24
|
export * from "./file-path-absolute-schema.vo";
|
|
20
25
|
export * from "./file-path-relative-schema.vo";
|
|
@@ -22,25 +27,39 @@ export * from "./filename.vo";
|
|
|
22
27
|
export * from "./filename-from-string.vo";
|
|
23
28
|
export * from "./filename-suffix.vo";
|
|
24
29
|
export * from "./height.vo";
|
|
30
|
+
export * from "./height-milimiters.vo";
|
|
25
31
|
export * from "./hour.vo";
|
|
32
|
+
export * from "./hour-format.service";
|
|
33
|
+
export * from "./hour-schema.vo";
|
|
26
34
|
export * from "./iban.vo";
|
|
27
35
|
export * from "./iban-mask.service";
|
|
36
|
+
export * from "./iban-schema.vo";
|
|
28
37
|
export * from "./image.vo";
|
|
38
|
+
export * from "./index";
|
|
29
39
|
export * from "./language.vo";
|
|
40
|
+
export * from "./linear-regression.service";
|
|
30
41
|
export * from "./mean.service";
|
|
31
42
|
export * from "./mime.vo";
|
|
32
43
|
export * from "./mime-types.vo";
|
|
44
|
+
export * from "./mime-value.vo";
|
|
33
45
|
export * from "./min-max-scaler.service";
|
|
34
46
|
export * from "./minute.vo";
|
|
47
|
+
export * from "./minute-schema.vo";
|
|
35
48
|
export * from "./money.vo";
|
|
49
|
+
export * from "./money-amount.vo";
|
|
36
50
|
export * from "./month.vo";
|
|
37
51
|
export * from "./month-iso-id.vo";
|
|
52
|
+
export * from "./multiplication-factor.vo";
|
|
38
53
|
export * from "./noop.service";
|
|
39
54
|
export * from "./notification-template.vo";
|
|
40
55
|
export * from "./object-key.vo";
|
|
41
56
|
export * from "./outlier-detector.service";
|
|
42
57
|
export * from "./package-version.vo";
|
|
58
|
+
export * from "./package-version-schema.vo";
|
|
43
59
|
export * from "./pagination.service";
|
|
60
|
+
export * from "./pagination-page.vo";
|
|
61
|
+
export * from "./pagination-skip.vo";
|
|
62
|
+
export * from "./pagination-take.vo";
|
|
44
63
|
export * from "./percentage.service";
|
|
45
64
|
export * from "./population-standard-deviation.service";
|
|
46
65
|
export * from "./quarter.vo";
|
|
@@ -49,15 +68,17 @@ export * from "./random.service";
|
|
|
49
68
|
export * from "./rate-limiter.service";
|
|
50
69
|
export * from "./relative-date.vo";
|
|
51
70
|
export * from "./reordering.service";
|
|
71
|
+
export * from "./reordering-item-position-value.vo";
|
|
52
72
|
export * from "./revision.vo";
|
|
73
|
+
export * from "./revision-value.vo";
|
|
53
74
|
export * from "./rounding.adapter";
|
|
54
75
|
export * from "./rounding.port";
|
|
55
|
-
export * from "./simple-linear-regression.service";
|
|
56
76
|
export * from "./size.vo";
|
|
77
|
+
export * from "./size-bytes.vo";
|
|
57
78
|
export * from "./stopwatch.service";
|
|
58
|
-
export * from "./streak-calculator.service";
|
|
59
79
|
export * from "./sum.service";
|
|
60
80
|
export * from "./thousands-separator.service";
|
|
81
|
+
export * from "./time.service";
|
|
61
82
|
export * from "./time-zone-offset-value.vo";
|
|
62
83
|
export * from "./timestamp.vo";
|
|
63
84
|
export * from "./timezone.vo";
|
|
@@ -67,6 +88,7 @@ export * from "./week.vo";
|
|
|
67
88
|
export * from "./week-iso-id.vo";
|
|
68
89
|
export * from "./weekday.vo";
|
|
69
90
|
export * from "./weight.vo";
|
|
91
|
+
export * from "./weight-grams.vo";
|
|
70
92
|
export * from "./year.vo";
|
|
71
93
|
export * from "./year-iso-id.vo";
|
|
72
94
|
export * from "./z-score.service";
|
package/dist/language.vo.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
2
|
export declare const LanguageError: {
|
|
3
|
-
readonly
|
|
3
|
+
readonly Type: "language.type";
|
|
4
|
+
readonly BadChars: "language.bad.chars";
|
|
4
5
|
};
|
|
5
6
|
export declare const Language: z.ZodString;
|
|
6
7
|
export type LanguageType = z.infer<typeof Language>;
|
package/dist/language.vo.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from "zod/v4";
|
|
2
|
-
export const LanguageError = {
|
|
2
|
+
export const LanguageError = { Type: "language.type", BadChars: "language.bad.chars" };
|
|
3
|
+
// Two lowercase letters
|
|
4
|
+
const LANGUAGE_CHARS_WHITELIST = /^[a-z]{2}$/;
|
|
3
5
|
export const Language = z
|
|
4
|
-
.string(LanguageError)
|
|
5
|
-
.
|
|
6
|
-
.regex(
|
|
6
|
+
.string(LanguageError.Type)
|
|
7
|
+
.toLowerCase()
|
|
8
|
+
.regex(LANGUAGE_CHARS_WHITELIST, LanguageError.BadChars);
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { RoundingPort } from "./rounding.port";
|
|
2
|
+
export type LinearRegressionPairType = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
6
|
+
export type LinearRegressionParamsType = {
|
|
7
|
+
a: number;
|
|
8
|
+
b: number;
|
|
9
|
+
};
|
|
10
|
+
export type LinearRegressionPredictionType = number;
|
|
11
|
+
export declare const LinearRegressionError: {
|
|
12
|
+
readonly MinPairs: "linear.regression.min.pairs";
|
|
13
|
+
readonly SumXTooBig: "linear.regression.sum.x.too.big";
|
|
14
|
+
readonly SumYTooBig: "linear.regression.sum.y.too.big";
|
|
15
|
+
readonly SumXSquaredTooBig: "linear.regression.sum.x.squared.too.big";
|
|
16
|
+
readonly SumXTimesYTooBig: "linear.regression.sum.x.times.y.too.big";
|
|
17
|
+
readonly ModelCreation: "linear.regression.model.creation";
|
|
18
|
+
};
|
|
19
|
+
export declare class LinearRegression {
|
|
20
|
+
private static readonly DEFAULT_ROUNDING;
|
|
21
|
+
private readonly params;
|
|
22
|
+
private readonly rounding;
|
|
23
|
+
constructor(params: LinearRegressionParamsType, rounding?: RoundingPort);
|
|
24
|
+
static fromPairs(pairs: LinearRegressionPairType[], rounding?: RoundingPort): LinearRegression;
|
|
25
|
+
predict(x: LinearRegressionPairType["x"], rounding?: RoundingPort): LinearRegressionPredictionType;
|
|
26
|
+
inspect(): LinearRegression["params"];
|
|
27
|
+
}
|