@bereasoftware/time-guard 2.3.0 → 2.4.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.
@@ -153,11 +153,7 @@ export declare class DurationResult implements DurationParts {
153
153
  */
154
154
  private generateExplanationSteps;
155
155
  /**
156
- * Get the conjunction for a locale
157
- */
158
- private getConjunction;
159
- /**
160
- * Pluralize a unit name
156
+ * Pluralize a unit name (deprecated - use utility function)
161
157
  */
162
158
  private pluralizeUnit;
163
159
  }
@@ -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.1",
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,30 @@
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
119
  "dependencies": {
114
120
  "@js-temporal/polyfill": "^0.5.1"
115
121
  },
116
122
  "devDependencies": {
123
+ "@js-temporal/polyfill": "^0.5.1",
117
124
  "@semantic-release/changelog": "^6.0.3",
118
125
  "@semantic-release/git": "^10.0.1",
119
126
  "@semantic-release/github": "^12.0.6",
120
127
  "@semantic-release/npm": "^13.1.5",
121
- "@types/node": "^25.5.0",
122
- "@vitest/ui": "^4.1.2",
128
+ "@types/node": "^25.6.0",
129
+ "@vitest/coverage-v8": "^4.1.4",
130
+ "@vitest/ui": "^4.1.4",
131
+ "prettier": "^3.8.2",
123
132
  "semantic-release": "^25.0.3",
124
133
  "typescript": "~6.0.2",
125
- "vite": "^8.0.3",
134
+ "vite": "^8.0.8",
126
135
  "vite-plugin-dts": "^4.5.4",
127
- "vitest": "^4.1.2"
136
+ "vitest": "^4.1.4"
128
137
  }
129
138
  }