@asterdoc/format 0.10.0 → 0.11.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.
- package/dist/index.d.ts +7 -1
- package/dist/index.js +3 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -87,4 +87,10 @@ declare const MISSING_RATING_SCALE = "missing_scale";
|
|
|
87
87
|
*/
|
|
88
88
|
declare const UNSUPPORTED_LIST_JOIN = "unsupported_list";
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
/**
|
|
91
|
+
* The `unsupported` outcome an address returns when its country has no layout.
|
|
92
|
+
* A caller that prints the generic layout instead keys its fallback off this code.
|
|
93
|
+
*/
|
|
94
|
+
declare const UNSUPPORTED_COUNTRY_LAYOUT = "unsupported_country_layout";
|
|
95
|
+
|
|
96
|
+
export { FORMAT_KINDS, FormatConfigurationError, FormatError, MISSING_RATING_SCALE, UNSUPPORTED_COUNTRY_LAYOUT, UNSUPPORTED_LIST_JOIN, UnsupportedLocaleError, createFormatter, defaultFormatter, formatAddress, formatAttachment, formatBbox, formatBoolean, formatCoordinate, formatDate, formatDatetime, formatDuration, formatEnum, formatIdentification, formatMoney, formatMultiselect, formatNumber, formatOrganization, formatParty, formatPercentage, formatPerson, formatPhone, formatRating, formatSignature, formatTime, formatValue, isFormatError, safeFormatAddress, safeFormatAttachment, safeFormatBbox, safeFormatBoolean, safeFormatCoordinate, safeFormatDate, safeFormatDatetime, safeFormatDuration, safeFormatEnum, safeFormatIdentification, safeFormatMoney, safeFormatMultiselect, safeFormatNumber, safeFormatOrganization, safeFormatParty, safeFormatPercentage, safeFormatPerson, safeFormatPhone, safeFormatRating, safeFormatSignature, safeFormatTime, safeFormatValue };
|
package/dist/index.js
CHANGED
|
@@ -92,6 +92,7 @@ function statusForIssues(issues) {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
// src/contacts.ts
|
|
95
|
+
var UNSUPPORTED_COUNTRY_LAYOUT = "unsupported_country_layout";
|
|
95
96
|
var UnsupportedAddressLayoutError = class extends Error {
|
|
96
97
|
country;
|
|
97
98
|
constructor(country) {
|
|
@@ -1937,7 +1938,7 @@ function failure(kind, error) {
|
|
|
1937
1938
|
if (error instanceof SelectionFormatError) return failed(error.status, [issue(kind, error.code, error.message)]);
|
|
1938
1939
|
if (error instanceof MissingMessageError) return failed("unsupported", [issue(kind, "missing_message", error.message, void 0, error)]);
|
|
1939
1940
|
if (error instanceof UnsupportedAddressLayoutError) {
|
|
1940
|
-
return failed("unsupported", [issue(kind,
|
|
1941
|
+
return failed("unsupported", [issue(kind, UNSUPPORTED_COUNTRY_LAYOUT, error.message, "country", error)]);
|
|
1941
1942
|
}
|
|
1942
1943
|
if (error instanceof UnsupportedLocaleError) return failed("unsupported", [issue(kind, "unsupported_locale", error.message, void 0, error)]);
|
|
1943
1944
|
if (error instanceof FormatConfigurationError) return failed("invalid", [issue(kind, "invalid_options", error.message, void 0, error)]);
|
|
@@ -2084,6 +2085,7 @@ export {
|
|
|
2084
2085
|
FormatConfigurationError,
|
|
2085
2086
|
FormatError,
|
|
2086
2087
|
MISSING_RATING_SCALE,
|
|
2088
|
+
UNSUPPORTED_COUNTRY_LAYOUT,
|
|
2087
2089
|
UNSUPPORTED_LIST_JOIN,
|
|
2088
2090
|
UnsupportedLocaleError,
|
|
2089
2091
|
createFormatter,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@asterdoc/format",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Locale-aware presentation formatting for Asterdoc artifact values",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@asterdoc/types": "^0.
|
|
50
|
+
"@asterdoc/types": "^0.11.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@types/node": "^22.15.3",
|
|
@@ -55,8 +55,8 @@
|
|
|
55
55
|
"tsup": "^8.4.0",
|
|
56
56
|
"typescript": "5.9.2",
|
|
57
57
|
"vitest": "^2.1.8",
|
|
58
|
-
"@asterdoc/
|
|
59
|
-
"@asterdoc/
|
|
58
|
+
"@asterdoc/typescript-config": "0.1.0",
|
|
59
|
+
"@asterdoc/eslint-config": "0.1.0"
|
|
60
60
|
},
|
|
61
61
|
"scripts": {
|
|
62
62
|
"build": "tsup",
|