@bgord/tools 1.2.3 → 1.2.5

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
@@ -79,7 +79,6 @@ export * from "./rounding.port";
79
79
  export * from "./size.vo";
80
80
  export * from "./size-bytes.vo";
81
81
  export * from "./slug.service";
82
- export * from "./stopwatch.service";
83
82
  export * from "./sum.service";
84
83
  export * from "./thousands-separator.service";
85
84
  export * from "./time-zone-offset-value.vo";
package/dist/index.js CHANGED
@@ -79,7 +79,6 @@ export * from "./rounding.port";
79
79
  export * from "./size.vo";
80
80
  export * from "./size-bytes.vo";
81
81
  export * from "./slug.service";
82
- export * from "./stopwatch.service";
83
82
  export * from "./sum.service";
84
83
  export * from "./thousands-separator.service";
85
84
  export * from "./time-zone-offset-value.vo";
@@ -1 +1,7 @@
1
- export declare const MIME_TYPES: Record<string, string[]>;
1
+ export declare const MIME_TYPES: {
2
+ readonly wildcard: readonly ["*/*"];
3
+ readonly jpeg: readonly ["image/jpeg"];
4
+ readonly png: readonly ["image/png"];
5
+ readonly wav: readonly ["audio/x-wav", "audio/wav"];
6
+ readonly mp4: readonly ["video/mp4"];
7
+ };
@@ -1 +1 @@
1
- {"root":["../src/age-years.vo.ts","../src/age.vo.ts","../src/api-key.vo.ts","../src/basename.vo.ts","../src/clock-format.service.ts","../src/clock.vo.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-format.service.ts","../src/hour-schema.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/language.vo.ts","../src/linear-regression.service.ts","../src/mean.service.ts","../src/mime-types.vo.ts","../src/mime-value.vo.ts","../src/mime.vo.ts","../src/min-max-scaler.service.ts","../src/minute-schema.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/notification-template.vo.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/revision-value.vo.ts","../src/revision.vo.ts","../src/rounding.adapter.ts","../src/rounding.port.ts","../src/size-bytes.vo.ts","../src/size.vo.ts","../src/slug.service.ts","../src/stopwatch.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.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/clock-format.service.ts","../src/clock.vo.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-format.service.ts","../src/hour-schema.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/language.vo.ts","../src/linear-regression.service.ts","../src/mean.service.ts","../src/mime-types.vo.ts","../src/mime-value.vo.ts","../src/mime.vo.ts","../src/min-max-scaler.service.ts","../src/minute-schema.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/notification-template.vo.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/revision-value.vo.ts","../src/revision.vo.ts","../src/rounding.adapter.ts","../src/rounding.port.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.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.2.3",
3
+ "version": "1.2.5",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "author": "Bartosz Gordon",
@@ -21,14 +21,14 @@
21
21
  "preinstall": "bunx only-allow bun"
22
22
  },
23
23
  "devDependencies": {
24
- "@biomejs/biome": "2.3.9",
24
+ "@biomejs/biome": "2.3.10",
25
25
  "@commitlint/cli": "20.2.0",
26
26
  "@commitlint/config-conventional": "20.2.0",
27
- "@types/bun": "1.3.4",
27
+ "@types/bun": "1.3.5",
28
28
  "@types/mime-types": "3.0.1",
29
29
  "cspell": "9.4.0",
30
- "knip": "5.75.1",
31
- "lefthook": "2.0.12",
30
+ "knip": "5.77.1",
31
+ "lefthook": "2.0.13",
32
32
  "lockfile-lint": "4.14.1",
33
33
  "only-allow": "1.2.2",
34
34
  "shellcheck": "4.1.0",
package/readme.md CHANGED
@@ -104,7 +104,6 @@ src/
104
104
  ├── size-bytes.vo.ts
105
105
  ├── size.vo.ts
106
106
  ├── slug.service.ts
107
- ├── stopwatch.service.ts
108
107
  ├── sum.service.ts
109
108
  ├── thousands-separator.service.ts
110
109
  ├── time-zone-offset-value.vo.ts
package/src/index.ts CHANGED
@@ -79,7 +79,6 @@ export * from "./rounding.port";
79
79
  export * from "./size.vo";
80
80
  export * from "./size-bytes.vo";
81
81
  export * from "./slug.service";
82
- export * from "./stopwatch.service";
83
82
  export * from "./sum.service";
84
83
  export * from "./thousands-separator.service";
85
84
  export * from "./time-zone-offset-value.vo";
@@ -1,7 +1,7 @@
1
- export const MIME_TYPES: Record<string, string[]> = {
1
+ export const MIME_TYPES = {
2
2
  wildcard: ["*/*"],
3
3
  jpeg: ["image/jpeg"],
4
4
  png: ["image/png"],
5
5
  wav: ["audio/x-wav", "audio/wav"],
6
6
  mp4: ["video/mp4"],
7
- };
7
+ } as const;
@@ -1,12 +0,0 @@
1
- import type { Duration } from "./duration.service";
2
- import { Timestamp } from "./timestamp.vo";
3
- export declare const StopwatchError: {
4
- AlreadyStopped: string;
5
- };
6
- export type StopwatchResultType = Duration;
7
- export declare class Stopwatch {
8
- private readonly start;
9
- private state;
10
- constructor(start: Timestamp);
11
- stop(): StopwatchResultType;
12
- }
@@ -1,20 +0,0 @@
1
- import { Timestamp } from "./timestamp.vo";
2
- export const StopwatchError = { AlreadyStopped: "stopwatch.already.stopped" };
3
- var StopwatchState;
4
- (function (StopwatchState) {
5
- StopwatchState["started"] = "started";
6
- StopwatchState["stopped"] = "stopped";
7
- })(StopwatchState || (StopwatchState = {}));
8
- export class Stopwatch {
9
- start;
10
- state = StopwatchState.started;
11
- constructor(start) {
12
- this.start = start;
13
- }
14
- stop() {
15
- if (this.state === StopwatchState.stopped)
16
- throw new Error(StopwatchError.AlreadyStopped);
17
- this.state = StopwatchState.stopped;
18
- return Timestamp.fromNumber(Date.now()).difference(this.start);
19
- }
20
- }
@@ -1,25 +0,0 @@
1
- import type { Duration } from "./duration.service";
2
- import { Timestamp } from "./timestamp.vo";
3
-
4
- export const StopwatchError = { AlreadyStopped: "stopwatch.already.stopped" };
5
-
6
- enum StopwatchState {
7
- started = "started",
8
- stopped = "stopped",
9
- }
10
-
11
- export type StopwatchResultType = Duration;
12
-
13
- export class Stopwatch {
14
- private state: StopwatchState = StopwatchState.started;
15
-
16
- constructor(private readonly start: Timestamp) {}
17
-
18
- stop(): StopwatchResultType {
19
- if (this.state === StopwatchState.stopped) throw new Error(StopwatchError.AlreadyStopped);
20
-
21
- this.state = StopwatchState.stopped;
22
-
23
- return Timestamp.fromNumber(Date.now()).difference(this.start);
24
- }
25
- }