@wix/l10n 1.198.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.
Files changed (88) hide show
  1. package/README.md +139 -0
  2. package/dist/cjs/__tests__/address.spec.js +365 -0
  3. package/dist/cjs/__tests__/address.spec.js.map +1 -0
  4. package/dist/cjs/__tests__/currency.spec.js +225 -0
  5. package/dist/cjs/__tests__/currency.spec.js.map +1 -0
  6. package/dist/cjs/__tests__/spec-setup.js +2 -0
  7. package/dist/cjs/__tests__/spec-setup.js.map +1 -0
  8. package/dist/cjs/address/formats.js +210 -0
  9. package/dist/cjs/address/formats.js.map +1 -0
  10. package/dist/cjs/address/formatsOverrides.js +23 -0
  11. package/dist/cjs/address/formatsOverrides.js.map +1 -0
  12. package/dist/cjs/address/formatter.js +21 -0
  13. package/dist/cjs/address/formatter.js.map +1 -0
  14. package/dist/cjs/address/index.js +8 -0
  15. package/dist/cjs/address/index.js.map +1 -0
  16. package/dist/cjs/address/model.js +2 -0
  17. package/dist/cjs/address/model.js.map +1 -0
  18. package/dist/cjs/address/parser.js +267 -0
  19. package/dist/cjs/address/parser.js.map +1 -0
  20. package/dist/cjs/currency/currencyCode.js +2 -0
  21. package/dist/cjs/currency/currencyCode.js.map +1 -0
  22. package/dist/cjs/currency/factory.js +37 -0
  23. package/dist/cjs/currency/factory.js.map +1 -0
  24. package/dist/cjs/currency/formatter.js +28 -0
  25. package/dist/cjs/currency/formatter.js.map +1 -0
  26. package/dist/cjs/external-types.d.js +3 -0
  27. package/dist/cjs/external-types.d.js.map +1 -0
  28. package/dist/cjs/generated/proto-generated.d.js +4 -0
  29. package/dist/cjs/generated/proto-generated.d.js.map +1 -0
  30. package/dist/cjs/index.js +18 -0
  31. package/dist/cjs/index.js.map +1 -0
  32. package/dist/cjs/test-types.d.js +2 -0
  33. package/dist/cjs/test-types.d.js.map +1 -0
  34. package/dist/esm/__tests__/address.spec.js +464 -0
  35. package/dist/esm/__tests__/address.spec.js.map +1 -0
  36. package/dist/esm/__tests__/currency.spec.js +178 -0
  37. package/dist/esm/__tests__/currency.spec.js.map +1 -0
  38. package/dist/esm/__tests__/spec-setup.js +2 -0
  39. package/dist/esm/__tests__/spec-setup.js.map +1 -0
  40. package/dist/esm/address/formats.js +8 -0
  41. package/dist/esm/address/formats.js.map +1 -0
  42. package/dist/esm/address/formatsOverrides.js +18 -0
  43. package/dist/esm/address/formatsOverrides.js.map +1 -0
  44. package/dist/esm/address/formatter.js +11 -0
  45. package/dist/esm/address/formatter.js.map +1 -0
  46. package/dist/esm/address/index.js +2 -0
  47. package/dist/esm/address/index.js.map +1 -0
  48. package/dist/esm/address/model.js +2 -0
  49. package/dist/esm/address/model.js.map +1 -0
  50. package/dist/esm/address/parser.js +227 -0
  51. package/dist/esm/address/parser.js.map +1 -0
  52. package/dist/esm/currency/currencyCode.js +2 -0
  53. package/dist/esm/currency/currencyCode.js.map +1 -0
  54. package/dist/esm/currency/factory.js +31 -0
  55. package/dist/esm/currency/factory.js.map +1 -0
  56. package/dist/esm/currency/formatter.js +18 -0
  57. package/dist/esm/currency/formatter.js.map +1 -0
  58. package/dist/esm/index.js +4 -0
  59. package/dist/esm/index.js.map +1 -0
  60. package/dist/tsconfig.tsbuildinfo +1 -0
  61. package/dist/types/__tests__/address.spec.d.ts +2 -0
  62. package/dist/types/__tests__/address.spec.d.ts.map +1 -0
  63. package/dist/types/__tests__/currency.spec.d.ts +2 -0
  64. package/dist/types/__tests__/currency.spec.d.ts.map +1 -0
  65. package/dist/types/__tests__/spec-setup.d.ts +1 -0
  66. package/dist/types/__tests__/spec-setup.d.ts.map +1 -0
  67. package/dist/types/address/formats.d.ts +8 -0
  68. package/dist/types/address/formats.d.ts.map +1 -0
  69. package/dist/types/address/formatsOverrides.d.ts +5 -0
  70. package/dist/types/address/formatsOverrides.d.ts.map +1 -0
  71. package/dist/types/address/formatter.d.ts +10 -0
  72. package/dist/types/address/formatter.d.ts.map +1 -0
  73. package/dist/types/address/index.d.ts +4 -0
  74. package/dist/types/address/index.d.ts.map +1 -0
  75. package/dist/types/address/model.d.ts +21 -0
  76. package/dist/types/address/model.d.ts.map +1 -0
  77. package/dist/types/address/parser.d.ts +24 -0
  78. package/dist/types/address/parser.d.ts.map +1 -0
  79. package/dist/types/currency/currencyCode.d.ts +7 -0
  80. package/dist/types/currency/currencyCode.d.ts.map +1 -0
  81. package/dist/types/currency/factory.d.ts +15 -0
  82. package/dist/types/currency/factory.d.ts.map +1 -0
  83. package/dist/types/currency/formatter.d.ts +18 -0
  84. package/dist/types/currency/formatter.d.ts.map +1 -0
  85. package/dist/types/generated/proto-generated.d.ts +1198 -0
  86. package/dist/types/index.d.ts +4 -0
  87. package/dist/types/index.d.ts.map +1 -0
  88. package/package.json +67 -0
package/README.md ADDED
@@ -0,0 +1,139 @@
1
+ # l10n
2
+
3
+ > l10n stands for the [localization](https://en.wikipedia.org/wiki/Language_localisation).
4
+
5
+ l10n is a library that aims to provide tools to help developers solve various localization problems.
6
+
7
+ ## Currency formatter
8
+
9
+ The library exports a function to create currency formatters configured to the user's language so that the user can avoid specifying it.
10
+
11
+ The library can be used directly and indirectly. If you import it directly, you will have to configure the language yourself. At the same time, if you use it through the Yoshi flows, you're free to skip this step as the language will be already set up for you.
12
+
13
+ **Direct usage example**
14
+
15
+ ```ts
16
+ import { createCurrencyFormatterWithDefaults } from "@wix/l10n";
17
+
18
+ const createCurrencyFormatter = createCurrencyFormatterWithDefaults({
19
+ language: "en"
20
+ });
21
+
22
+ const formatCurrency = createCurrencyFormatter({
23
+ minimumFractionDigits: 0
24
+ });
25
+
26
+ const price = formatCurrency({ value: 100, currency: "USD" }); // "$100"
27
+ ```
28
+
29
+ **Yoshi flow example**
30
+
31
+ ```tsx
32
+ import { useCurrencyFormatter } from "@wix/yoshi-flow-bm";
33
+
34
+ const MyApp = () => {
35
+ const formatCurrency = useCurrencyFormatter({
36
+ minimumFractionDigits: 2
37
+ });
38
+
39
+ return (
40
+ <span>
41
+ {formatCurrency({ value: 100, currency: "USD" })}
42
+ </span>
43
+ );
44
+ }
45
+ ```
46
+
47
+ > [Wix has a proto definition](https://github.com/wix-private/p13n/blob/master/protos/common/src/main/proto/wix/common/money.proto) for the money representation, so the library follows it to accept parameters according to it.
48
+ >
49
+ > The idea behind it is that in most cases developers get data to represent from the backend where money is represented according to this proto message.
50
+ >
51
+ > Having the same format eases the complexity as developers can use it to format the currency as is.
52
+
53
+ > `createCurrencyFormatter` (as well as a React hook) is a memoized function, meaning that when called with the same parameters, the same instance of the Intl formatter will be returned.
54
+ > This is done to increase performance, since creating Intl instances is expensive.
55
+
56
+ ### API
57
+
58
+ ##### CreateCurrencyFormatterWithDefaults
59
+
60
+ A function that returns a bound to the language factory to create formatters.
61
+
62
+ ```ts
63
+ type CreateCurrencyFormatterWithDefaults = (
64
+ params: { language: string }
65
+ ) => CreateCurrencyFormatter;
66
+ ```
67
+
68
+ ##### createCurrencyFormatter
69
+
70
+ A factory that returns formatters.
71
+
72
+ ```ts
73
+ type CreateCurrencyFormatter = (
74
+ params?: Partial<CreateCurrencyFormatterArgs>,
75
+ ) => (money: Money) => FormattedCurrencyResult;
76
+ ```
77
+
78
+ ##### CreateCurrencyFormatterArgs
79
+
80
+ For more information visit [NumberFormat specification](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat).
81
+
82
+ | Prop | Type | Default value | Description |
83
+ |:---------------------------|:----------|---------------|:--------------------------------------------------------------------------------------------------------------:|
84
+ | `parts` | `boolean` | `false` | Output in parts. Could be helpful when you want to decorate specific parts |
85
+ | `language` | `string` | `undefined` | For user facing values, the language should be taken from the user’s Wix account language. For user-of-user facing values, the country should be taken from Site Languages in Settings or from Multilingual |
86
+ | `country` | `string` | `undefined` | For user facing values, the country should be taken from the user’s browser. For user-of-user facing values, the country should be taken from Regional Format in Site Settings or Multilingual Regional Settings |
87
+ | `currencySign` | `string` | `undefined` | In many locales, accounting format means to wrap the number with parentheses instead of appending a minus sign |
88
+ | `useGrouping` | `boolean` | `false` | Whether to use grouping separators, such as thousands separators or thousand/lakh/crore separators. |
89
+ | `minimumIntegerDigits` | `number` | `undefined` | The minimum number of integer digits to use |
90
+ | `minimumFractionDigits` | `number` | `undefined` | The minimum number of fraction digits to use |
91
+ | `maximumFractionDigits` | `number` | `undefined` | The maximum number of fraction digits to use |
92
+ | `minimumSignificantDigits` | `number` | `undefined` | The minimum number of significant digits to use |
93
+ | `maximumSignificantDigits` | `number` | `undefined` | The maximum number of significant digits to use | | | | | |
94
+
95
+ ## Address formatter
96
+
97
+ A library for formatting [Wix addresses](https://github.com/wix-private/p13n/blob/master/protos/common/src/main/proto/wix/common/address.proto) in a localized format. The library addresses a simple yet annoying issue — the correct order of address parts for all countries.
98
+ The solution is based on the [Google's libaddressinput](https://github.com/google/libaddressinput/wiki/AddressValidationMetadata) which uses an [open source data set](https://chromium-i18n.appspot.com/ssl-address).
99
+
100
+ **Direct usage example**
101
+
102
+ ```ts
103
+ import { formatAddress } from "@wix/l10n";
104
+
105
+ const App = () => {
106
+ const address = formatAddress({
107
+ address: {
108
+ countryCode: 'US',
109
+ subdivision: 'TX',
110
+ city: 'Houston',
111
+ postalCode: '77032',
112
+ streetAddress: {
113
+ name: 'Polk St',
114
+ number: '4325',
115
+ },
116
+ country: 'United States',
117
+ },
118
+ addressContactDetails: {
119
+ company: 'Sax Therapist',
120
+ fullName: 'Martin Langford',
121
+ }
122
+ });
123
+
124
+ return (
125
+ <div>
126
+ {address.map(part => <span key={part}>{part}</span>)}
127
+ </div>
128
+ );
129
+
130
+ // <div>
131
+ // <span>Martin Langford</span>
132
+ // <span>Sax Therapist</span>
133
+ // <span>4325 Polk St</span>
134
+ // <span>Houston, TX 77032</span>
135
+ // <span>United States</span>
136
+ // </div>
137
+ }
138
+
139
+ ```
@@ -0,0 +1,365 @@
1
+ "use strict";
2
+
3
+ var _address = require("../address");
4
+ var _parser = require("../address/parser");
5
+ describe('address formatting', () => {
6
+ describe('tests for countries where street name comes first', () => {
7
+ _parser.streetNameFirstCountries.forEach(country => {
8
+ it(`should format the street name first address properly for ${country}`, () => {
9
+ const address = {
10
+ country,
11
+ streetAddress: {
12
+ apt: '11',
13
+ name: 'Street name',
14
+ number: '38'
15
+ },
16
+ city: 'City',
17
+ postalCode: '11111'
18
+ };
19
+ expect((0, _address.formatAddress)({
20
+ address
21
+ })).toMatchSnapshot();
22
+ });
23
+ });
24
+ });
25
+ describe('street adress format', () => {
26
+ test.each([['US', {
27
+ address: {
28
+ country: 'US',
29
+ subdivision: 'TX',
30
+ city: 'Houston',
31
+ postalCode: '77032',
32
+ streetAddress: {
33
+ name: 'Polk St',
34
+ number: '4325'
35
+ },
36
+ countryFullname: 'United States'
37
+ },
38
+ addressContactDetails: {
39
+ company: 'Sax Therapist',
40
+ fullName: 'Martin Langford'
41
+ }
42
+ }, ['Martin Langford', 'Sax Therapist', '4325 Polk St', 'Houston, TX 77032', 'United States']], ['GB', {
43
+ address: {
44
+ country: 'GB',
45
+ city: 'London',
46
+ postalCode: 'W1B 5PW',
47
+ streetAddress: {
48
+ name: 'Kingly St',
49
+ number: '10'
50
+ },
51
+ countryFullname: 'United Kingdom'
52
+ },
53
+ addressContactDetails: {
54
+ company: 'Detox Kitchen'
55
+ }
56
+ }, ['Detox Kitchen', '10 Kingly St', 'London', 'W1B 5PW', 'United Kingdom']], ['UA', {
57
+ address: {
58
+ country: 'UA',
59
+ countryFullname: 'Україна',
60
+ city: 'Київ',
61
+ postalCode: '02000',
62
+ streetAddress: {
63
+ name: 'вулиця Богдана Хмельницького',
64
+ number: '56А'
65
+ }
66
+ }
67
+ }, ['56А вулиця Богдана Хмельницького', 'Київ', '02000', 'Україна']], ['JP', {
68
+ address: {
69
+ country: 'JP',
70
+ countryFullname: '日本',
71
+ subdivision: '熊本県',
72
+ city: '熊本市',
73
+ postalCode: '321-432',
74
+ streetAddress: {
75
+ name: '東区榎町',
76
+ number: '23',
77
+ apt: '26'
78
+ },
79
+ addressLine2: 'ライオンズマンション'
80
+ }
81
+ }, ['〒321-432', '熊本県', '熊本市', '東区榎町 23-26', 'ライオンズマンション', '日本']], ['LT', {
82
+ address: {
83
+ country: 'LT',
84
+ countryFullname: 'Lithuania',
85
+ city: 'Vilnius',
86
+ postalCode: '09389',
87
+ streetAddress: {
88
+ name: 'Lvivo g.',
89
+ number: '34',
90
+ apt: '10'
91
+ },
92
+ addressLine2: '3 aukstas'
93
+ }
94
+ }, ['Lvivo g. 34-10', '3 aukstas', '09389 Vilnius', 'Lithuania']]])('should format %s address', (_countryCode, {
95
+ address,
96
+ addressContactDetails
97
+ }, result) => {
98
+ expect((0, _address.formatAddress)({
99
+ address,
100
+ addressContactDetails
101
+ })).toStrictEqual(result);
102
+ });
103
+ });
104
+ describe('address lines format', () => {
105
+ test.each([['US', {
106
+ address: {
107
+ country: 'US',
108
+ subdivision: 'TX',
109
+ city: 'Houston',
110
+ postalCode: '77032',
111
+ addressLine: '4325 Polk St',
112
+ countryFullname: 'United States'
113
+ },
114
+ addressContactDetails: {
115
+ company: 'Sax Therapist',
116
+ fullName: 'Martin Langford'
117
+ }
118
+ }, ['Martin Langford', 'Sax Therapist', '4325 Polk St', 'Houston, TX 77032', 'United States']], ['GB', {
119
+ address: {
120
+ country: 'GB',
121
+ city: 'London',
122
+ postalCode: 'W1B 5PW',
123
+ addressLine: '10 Kingly St',
124
+ countryFullname: 'United Kingdom'
125
+ },
126
+ addressContactDetails: {
127
+ company: 'Detox Kitchen'
128
+ }
129
+ }, ['Detox Kitchen', '10 Kingly St', 'London', 'W1B 5PW', 'United Kingdom']], ['UA', {
130
+ address: {
131
+ country: 'UA',
132
+ city: 'Київ',
133
+ postalCode: '02000',
134
+ addressLine: '56А вулиця Богдана Хмельницького',
135
+ countryFullname: 'Україна'
136
+ }
137
+ }, ['56А вулиця Богдана Хмельницького', 'Київ', '02000', 'Україна']], ['JP', {
138
+ address: {
139
+ country: 'JP',
140
+ countryFullname: '日本',
141
+ subdivision: '熊本県',
142
+ city: '熊本市',
143
+ postalCode: '321-432',
144
+ addressLine: '東区榎町23−26',
145
+ addressLine2: 'ライオンズマンション'
146
+ }
147
+ }, ['〒321-432', '熊本県', '熊本市', '東区榎町23−26', 'ライオンズマンション', '日本']], ['LT', {
148
+ address: {
149
+ country: 'LT',
150
+ countryFullname: 'Lithuania',
151
+ city: 'Vilnius',
152
+ postalCode: '09389',
153
+ addressLine: 'Lvivo g. 34-10',
154
+ addressLine2: '3 aukstas'
155
+ }
156
+ }, ['Lvivo g. 34-10', '3 aukstas', '09389 Vilnius', 'Lithuania']], ['FI', {
157
+ address: {
158
+ country: 'FI',
159
+ countryFullname: 'Finland',
160
+ city: 'Imatra',
161
+ postalCode: '55800',
162
+ addressLine: 'Vuoksenniskantie 83'
163
+ }
164
+ }, ['Vuoksenniskantie 83', '55800 Imatra', 'Finland']]])('should format %s address', (_countryCode, {
165
+ address,
166
+ addressContactDetails
167
+ }, result) => {
168
+ expect((0, _address.formatAddress)({
169
+ address,
170
+ addressContactDetails
171
+ })).toStrictEqual(result);
172
+ });
173
+ });
174
+ describe('Templates selection', () => {
175
+ it('should fallback to the default template in case the corresponding country code is not defined', () => {
176
+ const address = (0, _address.formatAddress)({
177
+ address: {
178
+ country: 'CM',
179
+ subdivision: 'Douala',
180
+ city: 'Akwa',
181
+ postalCode: '24239',
182
+ addressLine: 'BP. 24239',
183
+ countryFullname: 'Cameroun'
184
+ }
185
+ });
186
+ expect(address).toStrictEqual(['BP. 24239', 'Akwa', 'Cameroun']);
187
+ });
188
+ });
189
+ describe('CA/US address formatting', () => {
190
+ describe('Canada (CA) - apartment number first', () => {
191
+ it('should format address with apartment number in apt-number format', () => {
192
+ const address = {
193
+ country: 'CA',
194
+ subdivision: 'ON',
195
+ city: 'Toronto',
196
+ postalCode: 'M5H 2N2',
197
+ streetAddress: {
198
+ name: 'Bay Street',
199
+ number: '123',
200
+ apt: '456'
201
+ },
202
+ countryFullname: 'Canada'
203
+ };
204
+ const result = (0, _address.formatAddress)({
205
+ address
206
+ });
207
+ expect(result).toStrictEqual(['456-123 Bay Street', 'Toronto ON M5H 2N2', 'Canada']);
208
+ });
209
+ it('should format address without apartment number', () => {
210
+ const address = {
211
+ country: 'CA',
212
+ subdivision: 'BC',
213
+ city: 'Vancouver',
214
+ postalCode: 'V6B 2W9',
215
+ streetAddress: {
216
+ name: 'Granville Street',
217
+ number: '789'
218
+ },
219
+ countryFullname: 'Canada'
220
+ };
221
+ const result = (0, _address.formatAddress)({
222
+ address
223
+ });
224
+ expect(result).toStrictEqual(['789 Granville Street', 'Vancouver BC V6B 2W9', 'Canada']);
225
+ });
226
+ it('should format address with contact details', () => {
227
+ const address = {
228
+ country: 'CA',
229
+ subdivision: 'QC',
230
+ city: 'Montreal',
231
+ postalCode: 'H3A 0G4',
232
+ streetAddress: {
233
+ name: 'Sherbrooke Street',
234
+ number: '1234',
235
+ apt: '567'
236
+ },
237
+ countryFullname: 'Canada'
238
+ };
239
+ const addressContactDetails = {
240
+ fullName: 'John Doe',
241
+ company: 'Tech Corp'
242
+ };
243
+ const result = (0, _address.formatAddress)({
244
+ address,
245
+ addressContactDetails
246
+ });
247
+ expect(result).toStrictEqual(['John Doe', 'Tech Corp', '567-1234 Sherbrooke Street', 'Montreal QC H3A 0G4', 'Canada']);
248
+ });
249
+ });
250
+ describe('United States (US) - apartment number after street name', () => {
251
+ it('should format address with apartment number after street name', () => {
252
+ const address = {
253
+ country: 'US',
254
+ subdivision: 'NY',
255
+ city: 'New York',
256
+ postalCode: '10001',
257
+ streetAddress: {
258
+ name: 'Broadway',
259
+ number: '500',
260
+ apt: 'Apt 12B'
261
+ },
262
+ countryFullname: 'United States'
263
+ };
264
+ const result = (0, _address.formatAddress)({
265
+ address
266
+ });
267
+ expect(result).toStrictEqual(['500 Broadway Apt 12B', 'New York, NY 10001', 'United States']);
268
+ });
269
+ it('should format address without apartment number', () => {
270
+ const address = {
271
+ country: 'US',
272
+ subdivision: 'CA',
273
+ city: 'San Francisco',
274
+ postalCode: '94102',
275
+ streetAddress: {
276
+ name: 'Market Street',
277
+ number: '1234'
278
+ },
279
+ countryFullname: 'United States'
280
+ };
281
+ const result = (0, _address.formatAddress)({
282
+ address
283
+ });
284
+ expect(result).toStrictEqual(['1234 Market Street', 'San Francisco, CA 94102', 'United States']);
285
+ });
286
+ it('should format address with contact details and apartment', () => {
287
+ const address = {
288
+ country: 'US',
289
+ subdivision: 'FL',
290
+ city: 'Miami',
291
+ postalCode: '33101',
292
+ streetAddress: {
293
+ name: 'Ocean Drive',
294
+ number: '1500',
295
+ apt: 'Unit 5A'
296
+ },
297
+ countryFullname: 'United States'
298
+ };
299
+ const addressContactDetails = {
300
+ fullName: 'Jane Smith',
301
+ company: 'Design Studio'
302
+ };
303
+ const result = (0, _address.formatAddress)({
304
+ address,
305
+ addressContactDetails
306
+ });
307
+ expect(result).toStrictEqual(['Jane Smith', 'Design Studio', '1500 Ocean Drive Unit 5A', 'Miami, FL 33101', 'United States']);
308
+ });
309
+ it('should format address with numeric apartment number', () => {
310
+ const address = {
311
+ country: 'US',
312
+ subdivision: 'TX',
313
+ city: 'Austin',
314
+ postalCode: '78701',
315
+ streetAddress: {
316
+ name: 'Congress Avenue',
317
+ number: '200',
318
+ apt: '301'
319
+ },
320
+ countryFullname: 'United States'
321
+ };
322
+ const result = (0, _address.formatAddress)({
323
+ address
324
+ });
325
+ expect(result).toStrictEqual(['200 Congress Avenue 301', 'Austin, TX 78701', 'United States']);
326
+ });
327
+ });
328
+ describe('Edge cases', () => {
329
+ it('should handle CA address with only apartment number', () => {
330
+ const address = {
331
+ country: 'CA',
332
+ subdivision: 'AB',
333
+ city: 'Calgary',
334
+ postalCode: 'T2P 5C5',
335
+ streetAddress: {
336
+ name: 'Centre Street',
337
+ apt: '100'
338
+ },
339
+ countryFullname: 'Canada'
340
+ };
341
+ const result = (0, _address.formatAddress)({
342
+ address
343
+ });
344
+ expect(result).toStrictEqual(['Centre Street', 'Calgary AB T2P 5C5', 'Canada']);
345
+ });
346
+ it('should handle US address with only street name', () => {
347
+ const address = {
348
+ country: 'US',
349
+ subdivision: 'WA',
350
+ city: 'Seattle',
351
+ postalCode: '98101',
352
+ streetAddress: {
353
+ name: 'Pike Street'
354
+ },
355
+ countryFullname: 'United States'
356
+ };
357
+ const result = (0, _address.formatAddress)({
358
+ address
359
+ });
360
+ expect(result).toStrictEqual(['Pike Street', 'Seattle, WA 98101', 'United States']);
361
+ });
362
+ });
363
+ });
364
+ });
365
+ //# sourceMappingURL=address.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_address","require","_parser","describe","streetNameFirstCountries","forEach","country","it","address","streetAddress","apt","name","number","city","postalCode","expect","formatAddress","toMatchSnapshot","test","each","subdivision","countryFullname","addressContactDetails","company","fullName","addressLine2","_countryCode","result","toStrictEqual","addressLine"],"sources":["../../../src/__tests__/address.spec.ts"],"sourcesContent":["import { Address, formatAddress } from '../address';\nimport type { AddressContactDetails } from '../address/model';\nimport { streetNameFirstCountries } from '../address/parser';\n\ndescribe('address formatting', () => {\n describe('tests for countries where street name comes first', () => {\n streetNameFirstCountries.forEach((country) => {\n it(`should format the street name first address properly for ${country}`, () => {\n const address = {\n country,\n streetAddress: {\n apt: '11',\n name: 'Street name',\n number: '38',\n },\n city: 'City',\n postalCode: '11111',\n };\n\n expect(formatAddress({ address })).toMatchSnapshot();\n });\n });\n });\n\n describe('street adress format', () => {\n test.each([\n [\n 'US',\n {\n address: {\n country: 'US',\n subdivision: 'TX',\n city: 'Houston',\n postalCode: '77032',\n streetAddress: {\n name: 'Polk St',\n number: '4325',\n },\n countryFullname: 'United States',\n },\n addressContactDetails: {\n company: 'Sax Therapist',\n fullName: 'Martin Langford',\n },\n },\n [\n 'Martin Langford',\n 'Sax Therapist',\n '4325 Polk St',\n 'Houston, TX 77032',\n 'United States',\n ],\n ],\n [\n 'GB',\n {\n address: {\n country: 'GB',\n city: 'London',\n postalCode: 'W1B 5PW',\n streetAddress: {\n name: 'Kingly St',\n number: '10',\n },\n countryFullname: 'United Kingdom',\n },\n addressContactDetails: {\n company: 'Detox Kitchen',\n },\n },\n [\n 'Detox Kitchen',\n '10 Kingly St',\n 'London',\n 'W1B 5PW',\n 'United Kingdom',\n ],\n ],\n [\n 'UA',\n {\n address: {\n country: 'UA',\n countryFullname: 'Україна',\n city: 'Київ',\n postalCode: '02000',\n streetAddress: {\n name: 'вулиця Богдана Хмельницького',\n number: '56А',\n },\n },\n },\n ['56А вулиця Богдана Хмельницького', 'Київ', '02000', 'Україна'],\n ],\n [\n 'JP',\n {\n address: {\n country: 'JP',\n countryFullname: '日本',\n subdivision: '熊本県',\n city: '熊本市',\n postalCode: '321-432',\n streetAddress: {\n name: '東区榎町',\n number: '23',\n apt: '26',\n },\n addressLine2: 'ライオンズマンション',\n },\n },\n [\n '〒321-432',\n '熊本県',\n '熊本市',\n '東区榎町 23-26',\n 'ライオンズマンション',\n '日本',\n ],\n ],\n [\n 'LT',\n {\n address: {\n country: 'LT',\n countryFullname: 'Lithuania',\n city: 'Vilnius',\n postalCode: '09389',\n streetAddress: {\n name: 'Lvivo g.',\n number: '34',\n apt: '10',\n },\n addressLine2: '3 aukstas',\n },\n },\n ['Lvivo g. 34-10', '3 aukstas', '09389 Vilnius', 'Lithuania'],\n ],\n ] as [string, { address: Address; addressContactDetails?: AddressContactDetails }, string[]][])(\n 'should format %s address',\n (_countryCode, { address, addressContactDetails }, result) => {\n expect(formatAddress({ address, addressContactDetails })).toStrictEqual(\n result,\n );\n },\n );\n });\n\n describe('address lines format', () => {\n test.each([\n [\n 'US',\n {\n address: {\n country: 'US',\n subdivision: 'TX',\n city: 'Houston',\n postalCode: '77032',\n addressLine: '4325 Polk St',\n countryFullname: 'United States',\n },\n addressContactDetails: {\n company: 'Sax Therapist',\n fullName: 'Martin Langford',\n },\n },\n [\n 'Martin Langford',\n 'Sax Therapist',\n '4325 Polk St',\n 'Houston, TX 77032',\n 'United States',\n ],\n ],\n [\n 'GB',\n {\n address: {\n country: 'GB',\n city: 'London',\n postalCode: 'W1B 5PW',\n addressLine: '10 Kingly St',\n countryFullname: 'United Kingdom',\n },\n addressContactDetails: {\n company: 'Detox Kitchen',\n },\n },\n [\n 'Detox Kitchen',\n '10 Kingly St',\n 'London',\n 'W1B 5PW',\n 'United Kingdom',\n ],\n ],\n [\n 'UA',\n {\n address: {\n country: 'UA',\n city: 'Київ',\n postalCode: '02000',\n addressLine: '56А вулиця Богдана Хмельницького',\n countryFullname: 'Україна',\n },\n },\n ['56А вулиця Богдана Хмельницького', 'Київ', '02000', 'Україна'],\n ],\n [\n 'JP',\n {\n address: {\n country: 'JP',\n countryFullname: '日本',\n subdivision: '熊本県',\n city: '熊本市',\n postalCode: '321-432',\n addressLine: '東区榎町23−26',\n addressLine2: 'ライオンズマンション',\n },\n },\n [\n '〒321-432',\n '熊本県',\n '熊本市',\n '東区榎町23−26',\n 'ライオンズマンション',\n '日本',\n ],\n ],\n [\n 'LT',\n {\n address: {\n country: 'LT',\n countryFullname: 'Lithuania',\n city: 'Vilnius',\n postalCode: '09389',\n addressLine: 'Lvivo g. 34-10',\n addressLine2: '3 aukstas',\n },\n },\n ['Lvivo g. 34-10', '3 aukstas', '09389 Vilnius', 'Lithuania'],\n ],\n [\n 'FI',\n {\n address: {\n country: 'FI',\n countryFullname: 'Finland',\n city: 'Imatra',\n postalCode: '55800',\n addressLine: 'Vuoksenniskantie 83',\n },\n },\n ['Vuoksenniskantie 83', '55800 Imatra', 'Finland'],\n ],\n ] as [string, { address: Address; addressContactDetails?: AddressContactDetails }, string[]][])(\n 'should format %s address',\n (_countryCode, { address, addressContactDetails }, result) => {\n expect(formatAddress({ address, addressContactDetails })).toStrictEqual(\n result,\n );\n },\n );\n });\n\n describe('Templates selection', () => {\n it('should fallback to the default template in case the corresponding country code is not defined', () => {\n const address = formatAddress({\n address: {\n country: 'CM',\n subdivision: 'Douala',\n city: 'Akwa',\n postalCode: '24239',\n addressLine: 'BP. 24239',\n countryFullname: 'Cameroun',\n },\n });\n\n expect(address).toStrictEqual(['BP. 24239', 'Akwa', 'Cameroun']);\n });\n });\n\n describe('CA/US address formatting', () => {\n describe('Canada (CA) - apartment number first', () => {\n it('should format address with apartment number in apt-number format', () => {\n const address = {\n country: 'CA',\n subdivision: 'ON',\n city: 'Toronto',\n postalCode: 'M5H 2N2',\n streetAddress: {\n name: 'Bay Street',\n number: '123',\n apt: '456',\n },\n countryFullname: 'Canada',\n };\n\n const result = formatAddress({ address });\n expect(result).toStrictEqual([\n '456-123 Bay Street',\n 'Toronto ON M5H 2N2',\n 'Canada',\n ]);\n });\n\n it('should format address without apartment number', () => {\n const address = {\n country: 'CA',\n subdivision: 'BC',\n city: 'Vancouver',\n postalCode: 'V6B 2W9',\n streetAddress: {\n name: 'Granville Street',\n number: '789',\n },\n countryFullname: 'Canada',\n };\n\n const result = formatAddress({ address });\n expect(result).toStrictEqual([\n '789 Granville Street',\n 'Vancouver BC V6B 2W9',\n 'Canada',\n ]);\n });\n\n it('should format address with contact details', () => {\n const address = {\n country: 'CA',\n subdivision: 'QC',\n city: 'Montreal',\n postalCode: 'H3A 0G4',\n streetAddress: {\n name: 'Sherbrooke Street',\n number: '1234',\n apt: '567',\n },\n countryFullname: 'Canada',\n };\n\n const addressContactDetails = {\n fullName: 'John Doe',\n company: 'Tech Corp',\n };\n\n const result = formatAddress({ address, addressContactDetails });\n expect(result).toStrictEqual([\n 'John Doe',\n 'Tech Corp',\n '567-1234 Sherbrooke Street',\n 'Montreal QC H3A 0G4',\n 'Canada',\n ]);\n });\n });\n\n describe('United States (US) - apartment number after street name', () => {\n it('should format address with apartment number after street name', () => {\n const address = {\n country: 'US',\n subdivision: 'NY',\n city: 'New York',\n postalCode: '10001',\n streetAddress: {\n name: 'Broadway',\n number: '500',\n apt: 'Apt 12B',\n },\n countryFullname: 'United States',\n };\n\n const result = formatAddress({ address });\n expect(result).toStrictEqual([\n '500 Broadway Apt 12B',\n 'New York, NY 10001',\n 'United States',\n ]);\n });\n\n it('should format address without apartment number', () => {\n const address = {\n country: 'US',\n subdivision: 'CA',\n city: 'San Francisco',\n postalCode: '94102',\n streetAddress: {\n name: 'Market Street',\n number: '1234',\n },\n countryFullname: 'United States',\n };\n\n const result = formatAddress({ address });\n expect(result).toStrictEqual([\n '1234 Market Street',\n 'San Francisco, CA 94102',\n 'United States',\n ]);\n });\n\n it('should format address with contact details and apartment', () => {\n const address = {\n country: 'US',\n subdivision: 'FL',\n city: 'Miami',\n postalCode: '33101',\n streetAddress: {\n name: 'Ocean Drive',\n number: '1500',\n apt: 'Unit 5A',\n },\n countryFullname: 'United States',\n };\n\n const addressContactDetails = {\n fullName: 'Jane Smith',\n company: 'Design Studio',\n };\n\n const result = formatAddress({ address, addressContactDetails });\n expect(result).toStrictEqual([\n 'Jane Smith',\n 'Design Studio',\n '1500 Ocean Drive Unit 5A',\n 'Miami, FL 33101',\n 'United States',\n ]);\n });\n\n it('should format address with numeric apartment number', () => {\n const address = {\n country: 'US',\n subdivision: 'TX',\n city: 'Austin',\n postalCode: '78701',\n streetAddress: {\n name: 'Congress Avenue',\n number: '200',\n apt: '301',\n },\n countryFullname: 'United States',\n };\n\n const result = formatAddress({ address });\n expect(result).toStrictEqual([\n '200 Congress Avenue 301',\n 'Austin, TX 78701',\n 'United States',\n ]);\n });\n });\n\n describe('Edge cases', () => {\n it('should handle CA address with only apartment number', () => {\n const address = {\n country: 'CA',\n subdivision: 'AB',\n city: 'Calgary',\n postalCode: 'T2P 5C5',\n streetAddress: {\n name: 'Centre Street',\n apt: '100',\n },\n countryFullname: 'Canada',\n };\n\n const result = formatAddress({ address });\n expect(result).toStrictEqual([\n 'Centre Street',\n 'Calgary AB T2P 5C5',\n 'Canada',\n ]);\n });\n\n it('should handle US address with only street name', () => {\n const address = {\n country: 'US',\n subdivision: 'WA',\n city: 'Seattle',\n postalCode: '98101',\n streetAddress: {\n name: 'Pike Street',\n },\n countryFullname: 'United States',\n };\n\n const result = formatAddress({ address });\n expect(result).toStrictEqual([\n 'Pike Street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