@evlop/commons 1.0.115 → 1.0.118
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/helpers/base64.d.ts +3 -0
- package/dist/src/helpers/base64.d.ts.map +1 -0
- package/dist/src/helpers/base64.js +68 -0
- package/dist/src/helpers/base64.js.map +1 -0
- package/dist/src/helpers/index.d.ts +1 -0
- package/dist/src/helpers/index.d.ts.map +1 -1
- package/dist/src/helpers/index.js +1 -0
- package/dist/src/helpers/index.js.map +1 -1
- package/dist/src/hooks/useScope.d.ts.map +1 -1
- package/dist/src/hooks/useScope.js +2 -2
- package/dist/src/hooks/useScope.js.map +1 -1
- package/package.json +1 -1
@@ -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;QACC,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAI,GAAG,KAAK,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC;QAE7B,IAAI,GAAG,IAAI,IAAI,CAAC,CAAC;QACjB,IAAI,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QACvC,IAAI,GAAG,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QACxC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;QAEjB,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;YACb,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;SACpB;aAAM,IAAI,KAAK,CAAC,IAAI,CAAC,EAAE;YACpB,IAA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AG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QACzC,IAAI,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAEzC,IAAI,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QACjC,IAAI,GAAG,CAAC,CAAC,IAAI,GAAG,EAAE,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC;QACxC,IAAI,GAAG,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC;QAEhC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAE5C,IAAI,IAAI,IAAI,EAAE,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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/helpers/index.tsx"],"names":[],"mappings":"
|
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":";;;;;;;;;;;;
|
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"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useScope.d.ts","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"useScope.d.ts","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,QAAQ,mBAAoB,MAAM,iBAAiB,GAAG,QAMlE,CAAC;AAEF,OAAO,EAAC,QAAQ,IAAI,OAAO,EAAC,CAAC"}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.useData = exports.useScope = void 0;
|
4
|
+
const lodash_1 = require("lodash");
|
4
5
|
const react_1 = require("react");
|
5
6
|
const contexts_1 = require("../contexts");
|
6
7
|
const useScope = (scopeVariable, defaultValue) => {
|
7
8
|
const scope = react_1.useContext(contexts_1.DataContext);
|
8
9
|
if (scopeVariable) {
|
9
|
-
|
10
|
-
return value;
|
10
|
+
return lodash_1.get(scope, scopeVariable, defaultValue);
|
11
11
|
}
|
12
12
|
return scope;
|
13
13
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useScope.js","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":";;;AAAA,iCAAmC;AACnC,0CAA0C;AAEnC,MAAM,QAAQ,GAAG,CAAC,aAAsB,EAAE,YAAkB,EAAC,EAAE;IAClE,MAAM,KAAK,GAAS,kBAAU,CAAC,sBAAW,CAAC,CAAC;IAC5C,IAAG,aAAa,EAAC;QACb,
|
1
|
+
{"version":3,"file":"useScope.js","sourceRoot":"","sources":["../../../src/hooks/useScope.tsx"],"names":[],"mappings":";;;AAAA,mCAA6B;AAC7B,iCAAmC;AACnC,0CAA0C;AAEnC,MAAM,QAAQ,GAAG,CAAC,aAAsB,EAAE,YAAkB,EAAC,EAAE;IAClE,MAAM,KAAK,GAAS,kBAAU,CAAC,sBAAW,CAAC,CAAC;IAC5C,IAAG,aAAa,EAAC;QACb,OAAO,YAAG,CAAC,KAAK,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC;KAClD;IACD,OAAO,KAAK,CAAC;AACjB,CAAC,CAAC;AANW,QAAA,QAAQ,YAMnB;AAEkB,kBARP,gBAAQ,CAQM"}
|