@evlop/commons 1.0.116 → 1.0.119

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3 @@
1
+ export declare const encodeBase64: (input: string) => string;
2
+ export declare const decodeBase64: (input: string) => string;
3
+ //# sourceMappingURL=base64.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.d.ts","sourceRoot":"","sources":["../../../src/helpers/base64.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,UAAoB,MAAM,WAgClD,CAAC;AAEF,eAAO,MAAM,YAAY,UAAoB,MAAM,WAwClD,CAAC"}
@@ -0,0 +1,68 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.decodeBase64 = exports.encodeBase64 = void 0;
4
+ const keyStr = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
5
+ const encodeBase64 = function (input) {
6
+ let output = [];
7
+ let chr1, chr2, chr3 = "";
8
+ let enc1, enc2, enc3, enc4 = "";
9
+ let i = 0;
10
+ do {
11
+ chr1 = input.charCodeAt(i++);
12
+ chr2 = input.charCodeAt(i++);
13
+ chr3 = input.charCodeAt(i++);
14
+ enc1 = chr1 >> 2;
15
+ enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
16
+ enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
17
+ enc4 = chr3 & 63;
18
+ if (isNaN(chr2)) {
19
+ enc3 = enc4 = 64;
20
+ }
21
+ else if (isNaN(chr3)) {
22
+ enc4 = 64;
23
+ }
24
+ output.push(keyStr.charAt(enc1) +
25
+ keyStr.charAt(enc2) +
26
+ keyStr.charAt(enc3) +
27
+ keyStr.charAt(enc4));
28
+ chr1 = chr2 = chr3 = "";
29
+ enc1 = enc2 = enc3 = enc4 = "";
30
+ } while (i < input.length);
31
+ return output.join('');
32
+ };
33
+ exports.encodeBase64 = encodeBase64;
34
+ const decodeBase64 = function (input) {
35
+ let output = "";
36
+ let chr1, chr2, chr3 = "";
37
+ let enc1, enc2, enc3, enc4 = "";
38
+ let i = 0;
39
+ // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
40
+ var base64test = /[^A-Za-z0-9\+\/\=]/g;
41
+ if (base64test.exec(input)) {
42
+ throw new Error("There were invalid base64 characters in the input text.\n" +
43
+ "Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\n" +
44
+ "Expect errors in decoding.");
45
+ }
46
+ input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
47
+ do {
48
+ enc1 = keyStr.indexOf(input.charAt(i++));
49
+ enc2 = keyStr.indexOf(input.charAt(i++));
50
+ enc3 = keyStr.indexOf(input.charAt(i++));
51
+ enc4 = keyStr.indexOf(input.charAt(i++));
52
+ chr1 = (enc1 << 2) | (enc2 >> 4);
53
+ chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
54
+ chr3 = ((enc3 & 3) << 6) | enc4;
55
+ output = output + String.fromCharCode(chr1);
56
+ if (enc3 != 64) {
57
+ output = output + String.fromCharCode(chr2);
58
+ }
59
+ if (enc4 != 64) {
60
+ output = output + String.fromCharCode(chr3);
61
+ }
62
+ chr1 = chr2 = chr3 = "";
63
+ enc1 = enc2 = enc3 = enc4 = "";
64
+ } while (i < input.length);
65
+ return output;
66
+ };
67
+ exports.decodeBase64 = decodeBase64;
68
+ //# sourceMappingURL=base64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base64.js","sourceRoot":"","sources":["../../../src/helpers/base64.ts"],"names":[],"mappings":";;;AAAA,MAAM,MAAM,GAAG,mEAAmE,CAAC;AAE5E,MAAM,YAAY,GAAG,UAAU,KAAa;IAC/C,IAAI,MAAM,GAAG,EAAE,CAAC;IAChB,IAAI,IAAS,EAAE,IAAS,EAAE,IAAI,GAAQ,EAAE,CAAC;IACzC,IAAI,IAAS,EAAE,IAAS,EAAE,IAAS,EAAE,IAAI,GAAQ,EAAE,CAAC;IACpD,IAAI,CAAC,GAAG,CAAC,CAAC;IAEV,GAAG;QAC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EAAE;YACZ,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAC/C;QACD,IAAI,IAAI,IAAI,EAAE,EAAE;YACZ,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;SAC/C;QAED,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QACxB,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;KAElC,QAAQ,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE;IAE3B,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC;AAxCW,QAAA,YAAY,gBAwCvB"}
@@ -2,4 +2,5 @@ import './handlebarHelpers';
2
2
  export * from './functions';
3
3
  export * from './commonStyles';
4
4
  export * from './themeHelpers';
5
+ export * from './base64';
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AACA,OAAO,oBAAoB,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC"}
@@ -14,4 +14,5 @@ require("./handlebarHelpers");
14
14
  __exportStar(require("./functions"), exports);
15
15
  __exportStar(require("./commonStyles"), exports);
16
16
  __exportStar(require("./themeHelpers"), exports);
17
+ __exportStar(require("./base64"), exports);
17
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AACA,8BAA4B;AAC5B,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8BAA4B;AAC5B,8CAA4B;AAC5B,iDAA+B;AAC/B,iDAA+B;AAC/B,2CAAyB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evlop/commons",
3
- "version": "1.0.116",
3
+ "version": "1.0.119",
4
4
  "description": "",
5
5
  "main": "dist/main.js",
6
6
  "peerDependencies": {