@bereasoftware/time-guard 2.3.0 → 2.4.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.
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Shared locale utilities for duration formatting
3
+ * Extracted from DiffResult and DurationResult to avoid duplication
4
+ */
5
+ /**
6
+ * Duration unit labels for different locales
7
+ * Format: [singular, plural]
8
+ */
9
+ export declare const DURATION_UNIT_LABELS: Record<string, Record<string, [string, string]>>;
10
+ /**
11
+ * Conjunction words for joining duration parts
12
+ */
13
+ export declare const CONJUNCTION_LABELS: Record<string, string>;
14
+ /**
15
+ * Get duration unit label for a specific locale
16
+ */
17
+ export declare function getDurationUnitLabel(unit: string, locale: string, value: number): string;
18
+ /**
19
+ * Get conjunction word for a specific locale
20
+ */
21
+ export declare function getConjunctionLabel(locale: string): string;
22
+ /**
23
+ * Format a duration value with its unit label
24
+ */
25
+ export declare function formatDurationPart(value: number, unit: string, locale: string): string;
26
+ /**
27
+ * Join formatted duration parts with locale-appropriate conjunctions
28
+ */
29
+ export declare function joinDurationParts(parts: string[], locale: string): string;
30
+ /**
31
+ * Format a zero duration for display
32
+ */
33
+ export declare function formatZeroDuration(locale: string): string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bereasoftware/time-guard",
3
3
  "private": false,
4
- "version": "2.3.0",
4
+ "version": "2.4.0",
5
5
  "type": "module",
6
6
  "sideEffects": false,
7
7
  "main": "./dist/time-guard.cjs",
@@ -101,6 +101,7 @@
101
101
  "not IE 11",
102
102
  "> 1%"
103
103
  ],
104
+ "homepage": "https://github.com/Berea-Soft/time-guard#readme",
104
105
  "scripts": {
105
106
  "dev": "vite",
106
107
  "build": "vite build && vite build --mode umd",
@@ -108,22 +109,35 @@
108
109
  "test": "vitest run",
109
110
  "test:watch": "vitest",
110
111
  "test:ui": "vitest --ui",
111
- "lint": "tsc --noEmit"
112
+ "test:coverage": "vitest run --coverage",
113
+ "lint": "tsc --noEmit",
114
+ "lint:fix": "tsc --noEmit --pretty",
115
+ "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
116
+ "format:check": "prettier --check \"src/**/*.ts\" \"test/**/*.ts\"",
117
+ "prepublishOnly": "npm run build"
112
118
  },
113
- "dependencies": {
119
+ "peerDependencies": {
114
120
  "@js-temporal/polyfill": "^0.5.1"
115
121
  },
122
+ "peerDependenciesMeta": {
123
+ "@js-temporal/polyfill": {
124
+ "optional": true
125
+ }
126
+ },
116
127
  "devDependencies": {
128
+ "@js-temporal/polyfill": "^0.5.1",
117
129
  "@semantic-release/changelog": "^6.0.3",
118
130
  "@semantic-release/git": "^10.0.1",
119
131
  "@semantic-release/github": "^12.0.6",
120
132
  "@semantic-release/npm": "^13.1.5",
121
- "@types/node": "^25.5.0",
122
- "@vitest/ui": "^4.1.2",
133
+ "@types/node": "^25.6.0",
134
+ "@vitest/coverage-v8": "^4.1.4",
135
+ "@vitest/ui": "^4.1.4",
136
+ "prettier": "^3.8.2",
123
137
  "semantic-release": "^25.0.3",
124
138
  "typescript": "~6.0.2",
125
- "vite": "^8.0.3",
139
+ "vite": "^8.0.8",
126
140
  "vite-plugin-dts": "^4.5.4",
127
- "vitest": "^4.1.2"
141
+ "vitest": "^4.1.4"
128
142
  }
129
143
  }