@osimatic/helpers-js 1.1.61 → 1.1.63

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.
@@ -169,10 +169,13 @@ class TelephoneNumber {
169
169
  }
170
170
 
171
171
  static setIntlTelInput(input, placeholderNumberType) {
172
+ TelephoneNumber.localCountryCode = typeof TelephoneNumber.localCountryCode != 'undefined' ? TelephoneNumber.localCountryCode : null;
173
+ TelephoneNumber.intlTelInputUtilsPath = typeof TelephoneNumber.intlTelInputUtilsPath != 'undefined' ? TelephoneNumber.intlTelInputUtilsPath : null;
174
+
172
175
  return window.intlTelInput(input[0], {
173
- initialCountry: TelephoneNumber.localCountryCode,
176
+ initialCountry: null != TelephoneNumber.localCountryCode ? TelephoneNumber.localCountryCode.toLowerCase() : null, // depuis version 19.x, le code pays doit être en minuscule
174
177
  placeholderNumberType: placeholderNumberType || 'FIXED_LINE_OR_MOBILE',
175
- utilsScript: typeof TelephoneNumber.intlTelInputUtilsPath != 'undefined' ? TelephoneNumber.intlTelInputUtilsPath : null
178
+ utilsScript: TelephoneNumber.intlTelInputUtilsPath
176
179
  });
177
180
  }
178
181
 
package/http_client.js CHANGED
@@ -345,9 +345,13 @@ class HTTPClient {
345
345
  }
346
346
  }
347
347
  else {
348
- HTTPClient.logRequestFailure(response, null);
348
+ let json = null;
349
+ if (response.headers.get('Content-Type') === 'application/json') {
350
+ json = await response.json();
351
+ }
352
+ HTTPClient.logRequestFailure(response, json);
349
353
  if (typeof errorCallback == 'function') {
350
- errorCallback(response);
354
+ errorCallback(response, json);
351
355
  }
352
356
  }
353
357
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osimatic/helpers-js",
3
- "version": "1.1.61",
3
+ "version": "1.1.63",
4
4
  "main": "main.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"