@bgord/tools 1.4.2 → 1.4.4

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/index.d.ts CHANGED
@@ -86,7 +86,10 @@ export * from "./rounding-up.strategy";
86
86
  export * from "./size.vo";
87
87
  export * from "./size-bytes.vo";
88
88
  export * from "./slug.service";
89
+ export * from "./sms-body.vo";
90
+ export * from "./sms-message.vo";
89
91
  export * from "./sum.service";
92
+ export * from "./telephone-number.vo";
90
93
  export * from "./thousands-separator.service";
91
94
  export * from "./time-zone-offset-value.vo";
92
95
  export * from "./timestamp.vo";
package/dist/index.js CHANGED
@@ -86,7 +86,10 @@ export * from "./rounding-up.strategy";
86
86
  export * from "./size.vo";
87
87
  export * from "./size-bytes.vo";
88
88
  export * from "./slug.service";
89
+ export * from "./sms-body.vo";
90
+ export * from "./sms-message.vo";
89
91
  export * from "./sum.service";
92
+ export * from "./telephone-number.vo";
90
93
  export * from "./thousands-separator.service";
91
94
  export * from "./time-zone-offset-value.vo";
92
95
  export * from "./timestamp.vo";
@@ -0,0 +1,8 @@
1
+ import * as v from "valibot";
2
+ export declare const SmsBodyError: {
3
+ Type: string;
4
+ Empty: string;
5
+ TooLong: string;
6
+ };
7
+ export declare const SmsBody: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.MinLengthAction<string, 1, string>, v.MaxLengthAction<string, 640, string>, v.BrandAction<string, "SmsBody">]>;
8
+ export type SmsBodyType = v.InferOutput<typeof SmsBody>;
@@ -0,0 +1,9 @@
1
+ import * as v from "valibot";
2
+ export const SmsBodyError = {
3
+ Type: "sms.body.type",
4
+ Empty: "sms.body.empty",
5
+ TooLong: "sms.body.too.long",
6
+ };
7
+ export const SmsBody = v.pipe(v.string(SmsBodyError.Type), v.minLength(1, SmsBodyError.Empty), v.maxLength(640, SmsBodyError.TooLong),
8
+ // Stryker disable next-line StringLiteral
9
+ v.brand("SmsBody"));
@@ -0,0 +1,13 @@
1
+ import type { SmsBodyType } from "./sms-body.vo";
2
+ import type { TelephoneNumberType } from "./telephone-number.vo";
3
+ export declare class SmsMessage {
4
+ readonly to: TelephoneNumberType;
5
+ readonly body: SmsBodyType;
6
+ readonly from?: TelephoneNumberType | undefined;
7
+ constructor(to: TelephoneNumberType, body: SmsBodyType, from?: TelephoneNumberType | undefined);
8
+ toJSON(): {
9
+ to: string & import("valibot").Brand<"TelephoneNumber">;
10
+ from: (string & import("valibot").Brand<"TelephoneNumber">) | undefined;
11
+ body: string & import("valibot").Brand<"SmsBody">;
12
+ };
13
+ }
@@ -0,0 +1,13 @@
1
+ export class SmsMessage {
2
+ to;
3
+ body;
4
+ from;
5
+ constructor(to, body, from) {
6
+ this.to = to;
7
+ this.body = body;
8
+ this.from = from;
9
+ }
10
+ toJSON() {
11
+ return { to: this.to, from: this.from, body: this.body };
12
+ }
13
+ }
@@ -0,0 +1,7 @@
1
+ import * as v from "valibot";
2
+ export declare const TelephoneNumberError: {
3
+ Type: string;
4
+ Invalid: string;
5
+ };
6
+ export declare const TelephoneNumber: v.SchemaWithPipe<readonly [v.StringSchema<string>, v.RegexAction<string, string>, v.BrandAction<string, "TelephoneNumber">]>;
7
+ export type TelephoneNumberType = v.InferOutput<typeof TelephoneNumber>;
@@ -0,0 +1,10 @@
1
+ import * as v from "valibot";
2
+ export const TelephoneNumberError = {
3
+ Type: "telephone.number.type",
4
+ Invalid: "telephone.number.invalid",
5
+ };
6
+ // E.164 format: + followed by 2-15 digits, no leading zero in country code
7
+ const E164 = /^\+[1-9]\d{1,14}$/;
8
+ export const TelephoneNumber = v.pipe(v.string(TelephoneNumberError.Type), v.regex(E164, TelephoneNumberError.Invalid),
9
+ // Stryker disable next-line StringLiteral
10
+ v.brand("TelephoneNumber"));
@@ -1 +1 @@
1
- {"root":["../src/age-years.vo.ts","../src/age.vo.ts","../src/api-key.vo.ts","../src/basename.vo.ts","../src/batch.ts","../src/date-calculator.service.ts","../src/date-formatter.service.ts","../src/date-range.vo.ts","../src/day-iso-id.vo.ts","../src/day.vo.ts","../src/directory-path-absolute.vo.ts","../src/directory-path-relative.vo.ts","../src/distance-value.vo.ts","../src/distance.vo.ts","../src/division-factor.vo.ts","../src/dll.service.ts","../src/duration-ms.vo.ts","../src/duration.service.ts","../src/email-mask.service.ts","../src/email.vo.ts","../src/etags.vo.ts","../src/extension.vo.ts","../src/feature-flag-value.vo.ts","../src/feature-flag.vo.ts","../src/file-path-absolute-schema.vo.ts","../src/file-path-relative-schema.vo.ts","../src/file-path.vo.ts","../src/filename-affix.vo.ts","../src/filename-from-string.vo.ts","../src/filename.vo.ts","../src/height-milimiters.vo.ts","../src/height.vo.ts","../src/hour-value.vo.ts","../src/hour.vo.ts","../src/iban-mask.service.ts","../src/iban-schema.vo.ts","../src/iban.vo.ts","../src/image.vo.ts","../src/index.ts","../src/int.vo.ts","../src/integer-non-negative.vo.ts","../src/integer-positive.vo.ts","../src/integer.vo.ts","../src/language.vo.ts","../src/linear-regression.service.ts","../src/mean.service.ts","../src/mime-registry-entry.vo.ts","../src/mime-registry.service.ts","../src/mime-value.vo.ts","../src/mime.vo.ts","../src/mimes.ts","../src/min-max-scaler.service.ts","../src/minute-value.vo.ts","../src/minute.vo.ts","../src/money-amount.vo.ts","../src/money.vo.ts","../src/month-iso-id.vo.ts","../src/month.vo.ts","../src/multiplication-factor.vo.ts","../src/noop.service.ts","../src/object-key.vo.ts","../src/outlier-detector.service.ts","../src/package-version-schema.vo.ts","../src/package-version.vo.ts","../src/pagination-page.vo.ts","../src/pagination-skip.vo.ts","../src/pagination-take.vo.ts","../src/pagination.service.ts","../src/percentage.service.ts","../src/population-standard-deviation.service.ts","../src/quarter-iso-id.vo.ts","../src/quarter.vo.ts","../src/random.service.ts","../src/rate-limiter.service.ts","../src/relative-date.vo.ts","../src/reordering-item-position-value.vo.ts","../src/reordering.service.ts","../src/repeat.ts","../src/revision-value.vo.ts","../src/revision.vo.ts","../src/rounding-decimal.strategy.ts","../src/rounding-down.strategy.ts","../src/rounding-to-nearest.strategy.ts","../src/rounding-up.strategy.ts","../src/rounding.strategy.ts","../src/size-bytes.vo.ts","../src/size.vo.ts","../src/slug.service.ts","../src/sum.service.ts","../src/thousands-separator.service.ts","../src/time-zone-offset-value.vo.ts","../src/timestamp-value.vo.ts","../src/timestamp.vo.ts","../src/timezone.vo.ts","../src/ts-utils.ts","../src/url-with-slash.vo.ts","../src/url-without-slash.vo.ts","../src/visually-unambiguous-characters-generator.service.ts","../src/week-iso-id.vo.ts","../src/week.vo.ts","../src/weekday-iso-id.vo.ts","../src/weekday.vo.ts","../src/weight-grams.vo.ts","../src/weight.vo.ts","../src/year-iso-id.vo.ts","../src/year.vo.ts","../src/z-score.service.ts"],"version":"5.9.3"}
1
+ {"root":["../src/age-years.vo.ts","../src/age.vo.ts","../src/api-key.vo.ts","../src/basename.vo.ts","../src/batch.ts","../src/date-calculator.service.ts","../src/date-formatter.service.ts","../src/date-range.vo.ts","../src/day-iso-id.vo.ts","../src/day.vo.ts","../src/directory-path-absolute.vo.ts","../src/directory-path-relative.vo.ts","../src/distance-value.vo.ts","../src/distance.vo.ts","../src/division-factor.vo.ts","../src/dll.service.ts","../src/duration-ms.vo.ts","../src/duration.service.ts","../src/email-mask.service.ts","../src/email.vo.ts","../src/etags.vo.ts","../src/extension.vo.ts","../src/feature-flag-value.vo.ts","../src/feature-flag.vo.ts","../src/file-path-absolute-schema.vo.ts","../src/file-path-relative-schema.vo.ts","../src/file-path.vo.ts","../src/filename-affix.vo.ts","../src/filename-from-string.vo.ts","../src/filename.vo.ts","../src/height-milimiters.vo.ts","../src/height.vo.ts","../src/hour-value.vo.ts","../src/hour.vo.ts","../src/iban-mask.service.ts","../src/iban-schema.vo.ts","../src/iban.vo.ts","../src/image.vo.ts","../src/index.ts","../src/int.vo.ts","../src/integer-non-negative.vo.ts","../src/integer-positive.vo.ts","../src/integer.vo.ts","../src/language.vo.ts","../src/linear-regression.service.ts","../src/mean.service.ts","../src/mime-registry-entry.vo.ts","../src/mime-registry.service.ts","../src/mime-value.vo.ts","../src/mime.vo.ts","../src/mimes.ts","../src/min-max-scaler.service.ts","../src/minute-value.vo.ts","../src/minute.vo.ts","../src/money-amount.vo.ts","../src/money.vo.ts","../src/month-iso-id.vo.ts","../src/month.vo.ts","../src/multiplication-factor.vo.ts","../src/noop.service.ts","../src/object-key.vo.ts","../src/outlier-detector.service.ts","../src/package-version-schema.vo.ts","../src/package-version.vo.ts","../src/pagination-page.vo.ts","../src/pagination-skip.vo.ts","../src/pagination-take.vo.ts","../src/pagination.service.ts","../src/percentage.service.ts","../src/population-standard-deviation.service.ts","../src/quarter-iso-id.vo.ts","../src/quarter.vo.ts","../src/random.service.ts","../src/rate-limiter.service.ts","../src/relative-date.vo.ts","../src/reordering-item-position-value.vo.ts","../src/reordering.service.ts","../src/repeat.ts","../src/revision-value.vo.ts","../src/revision.vo.ts","../src/rounding-decimal.strategy.ts","../src/rounding-down.strategy.ts","../src/rounding-to-nearest.strategy.ts","../src/rounding-up.strategy.ts","../src/rounding.strategy.ts","../src/size-bytes.vo.ts","../src/size.vo.ts","../src/slug.service.ts","../src/sms-body.vo.ts","../src/sms-message.vo.ts","../src/sum.service.ts","../src/telephone-number.vo.ts","../src/thousands-separator.service.ts","../src/time-zone-offset-value.vo.ts","../src/timestamp-value.vo.ts","../src/timestamp.vo.ts","../src/timezone.vo.ts","../src/ts-utils.ts","../src/url-with-slash.vo.ts","../src/url-without-slash.vo.ts","../src/visually-unambiguous-characters-generator.service.ts","../src/week-iso-id.vo.ts","../src/week.vo.ts","../src/weekday-iso-id.vo.ts","../src/weekday.vo.ts","../src/weight-grams.vo.ts","../src/weight.vo.ts","../src/year-iso-id.vo.ts","../src/year.vo.ts","../src/z-score.service.ts"],"version":"5.9.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bgord/tools",
3
- "version": "1.4.2",
3
+ "version": "1.4.4",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Bartosz Gordon",
@@ -20,13 +20,13 @@
20
20
  "preinstall": "bunx only-allow bun"
21
21
  },
22
22
  "devDependencies": {
23
- "@biomejs/biome": "2.4.7",
23
+ "@biomejs/biome": "2.4.8",
24
24
  "@commitlint/cli": "20.5.0",
25
25
  "@commitlint/config-conventional": "20.5.0",
26
26
  "@stryker-mutator/core": "9.6.0",
27
- "@types/bun": "1.3.10",
27
+ "@types/bun": "1.3.11",
28
28
  "cspell": "9.7.0",
29
- "knip": "5.87.0",
29
+ "knip": "6.0.0",
30
30
  "lefthook": "2.1.4",
31
31
  "lockfile-lint": "5.0.0",
32
32
  "only-allow": "1.2.2",
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "dependencies": {
37
37
  "date-fns": "4.1.0",
38
- "valibot": "1.3.0"
38
+ "valibot": "1.3.1"
39
39
  },
40
40
  "sideEffects": false
41
41
  }
package/readme.md CHANGED
@@ -111,7 +111,10 @@ src/
111
111
  ├── size-bytes.vo.ts
112
112
  ├── size.vo.ts
113
113
  ├── slug.service.ts
114
+ ├── sms-body.vo.ts
115
+ ├── sms-message.vo.ts
114
116
  ├── sum.service.ts
117
+ ├── telephone-number.vo.ts
115
118
  ├── thousands-separator.service.ts
116
119
  ├── time-zone-offset-value.vo.ts
117
120
  ├── timestamp-value.vo.ts