@osimatic/helpers-js 1.0.65 → 1.0.68

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/bank.js CHANGED
@@ -13,8 +13,7 @@ class BankCard {
13
13
  return cardNumber;
14
14
  }
15
15
 
16
- static formatExpirationDate(expirationDate) {
17
- let locale = typeof locale != 'undefined' ? locale : 'fr-FR';
16
+ static formatExpirationDate(expirationDate, locale="fr-FR") {
18
17
  return SqlDateTime.getMonthName(expirationDate, locale)+' '+SqlDateTime.getYear(expirationDate);
19
18
  }
20
19
  }
package/file.js CHANGED
@@ -61,6 +61,16 @@ class File {
61
61
  maximumFractionDigits: fractionDigits
62
62
  }).format(size)) + ' ' + byteUnits[i];
63
63
  }
64
+
65
+ static blobToBase64(blob, callback) {
66
+ let reader = new FileReader();
67
+ reader.onload = function() {
68
+ //let dataUrl = reader.result;
69
+ //let base64 = dataUrl.split(',')[1];
70
+ callback(reader.result);
71
+ };
72
+ reader.readAsDataURL(blob);
73
+ };
64
74
  }
65
75
 
66
76
  const CSV_FILE_EXTENSION = "csv";
package/network.js CHANGED
@@ -119,7 +119,7 @@ class HTTPRequest {
119
119
  }
120
120
 
121
121
  static logJqueryRequestFailure(jqxhr, status, errorThrown) {
122
- console.error('Request failure. Status: '+status+' ; HTTP Code: '+jqxhr.responseJSON.code+(null!=errorThrown && ''!==errorThrown ? ' ; Error message: '+errorThrown : ''), jqxhr.responseJSON);
122
+ console.error('Request failure. Status: '+status+' ; HTTP Code: '+jqxhr.status+(null!=errorThrown && ''!==errorThrown ? ' ; Error message: '+errorThrown : ''), jqxhr.responseJSON);
123
123
  }
124
124
 
125
125
  static isExpiredToken(response, json) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osimatic/helpers-js",
3
- "version": "1.0.65",
3
+ "version": "1.0.68",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"