@nuskin/contentstack-lib 2.1.0-pa-1117.2 → 2.1.0-pa-1117.3
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/__tests__/api.spec.js +12 -4
- package/docs/CHANGELOG.md +1 -1
- package/package.json +1 -1
- package/src/api.js +9 -2
package/__tests__/api.spec.js
CHANGED
|
@@ -209,7 +209,9 @@ describe("ContentstackApi", () => {
|
|
|
209
209
|
{
|
|
210
210
|
title: 'United States',
|
|
211
211
|
address_elements: addressFormFieldEntries,
|
|
212
|
-
postal_code_regex: '^[0-9]{5}(?:-[0-9]{4})?$'
|
|
212
|
+
postal_code_regex: '^[0-9]{5}(?:-[0-9]{4})?$',
|
|
213
|
+
verify_after_autocomplete: true,
|
|
214
|
+
wrap_address1_to_address2: false
|
|
213
215
|
}
|
|
214
216
|
]]);
|
|
215
217
|
const {getStack} = require('../src/api');
|
|
@@ -232,7 +234,9 @@ describe("ContentstackApi", () => {
|
|
|
232
234
|
required: false
|
|
233
235
|
}
|
|
234
236
|
],
|
|
235
|
-
postal_code_regex: '^[0-9]{5}(?:-[0-9]{4})?$'
|
|
237
|
+
postal_code_regex: '^[0-9]{5}(?:-[0-9]{4})?$',
|
|
238
|
+
verify_after_autocomplete: true,
|
|
239
|
+
wrap_address1_to_address2: false
|
|
236
240
|
}
|
|
237
241
|
]);
|
|
238
242
|
});
|
|
@@ -241,7 +245,9 @@ describe("ContentstackApi", () => {
|
|
|
241
245
|
mockPromiseResult.mockResolvedValueOnce([[
|
|
242
246
|
{
|
|
243
247
|
address_elements: addressFormFieldEntries,
|
|
244
|
-
postal_code_regex: '^[0-9]{5}(?:-[0-9]{4})?$'
|
|
248
|
+
postal_code_regex: '^[0-9]{5}(?:-[0-9]{4})?$',
|
|
249
|
+
verify_after_autocomplete: true,
|
|
250
|
+
wrap_address1_to_address2: false
|
|
245
251
|
}
|
|
246
252
|
]]);
|
|
247
253
|
const {getStack} = require('../src/api');
|
|
@@ -264,7 +270,9 @@ describe("ContentstackApi", () => {
|
|
|
264
270
|
required: false
|
|
265
271
|
}
|
|
266
272
|
],
|
|
267
|
-
postalCodeRegex: '^[0-9]{5}(?:-[0-9]{4})?$'
|
|
273
|
+
postalCodeRegex: '^[0-9]{5}(?:-[0-9]{4})?$',
|
|
274
|
+
verifyAfterAutocomplete: true,
|
|
275
|
+
wrapAddress1ToAddress2: false
|
|
268
276
|
}
|
|
269
277
|
]);
|
|
270
278
|
});
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# [2.1.0-pa-1117.
|
|
1
|
+
# [2.1.0-pa-1117.3](https://code.tls.nuskin.io/ns-am/utility/npm/contentstack-lib/compare/v2.1.0-pa-1117.2...v2.1.0-pa-1117.3) (2026-04-06)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuskin/contentstack-lib",
|
|
3
|
-
"version": "2.1.0-pa-1117.
|
|
3
|
+
"version": "2.1.0-pa-1117.3",
|
|
4
4
|
"description": "This project contains configuration and api code to access Contentstack, to be shared between the backend (AWS Lambda) and frontend (Vue, etc).",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
package/src/api.js
CHANGED
|
@@ -230,9 +230,16 @@ const getShippingAddressForms = async (countries, camelcase = false) => {
|
|
|
230
230
|
|
|
231
231
|
const getAddressForms = async (countries, camelcase = false) => {
|
|
232
232
|
const results = await _getMultiEntries('address_form', 'address_elements', countries);
|
|
233
|
-
const mappedResults = (results || []).map(({
|
|
233
|
+
const mappedResults = (results || []).map(({
|
|
234
|
+
address_elements,
|
|
235
|
+
postal_code_regex,
|
|
236
|
+
verify_after_autocomplete,
|
|
237
|
+
wrap_address1_to_address2
|
|
238
|
+
}) => ({
|
|
234
239
|
address_elements: _extractAddressFormFields(address_elements, camelcase),
|
|
235
|
-
postal_code_regex
|
|
240
|
+
postal_code_regex,
|
|
241
|
+
verify_after_autocomplete,
|
|
242
|
+
wrap_address1_to_address2
|
|
236
243
|
}));
|
|
237
244
|
|
|
238
245
|
return camelcase ? _snakeObjectToCamel(mappedResults) : mappedResults;
|