@sogni-ai/sogni-client 0.4.0-aplha.5 → 0.4.0-aplha.6
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/dist/lib/base64.js +8 -6
- package/dist/lib/base64.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/src/lib/base64.ts +8 -4
- package/src/version.ts +1 -1
package/dist/lib/base64.js
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.base64Encode = base64Encode;
|
|
7
4
|
exports.base64Decode = base64Decode;
|
|
8
|
-
const isNodejs_1 = __importDefault(require("./isNodejs"));
|
|
9
5
|
function base64Encode(str) {
|
|
10
|
-
|
|
6
|
+
const encoder = new TextEncoder();
|
|
7
|
+
const uint8Array = encoder.encode(str);
|
|
8
|
+
const binaryString = String.fromCharCode(...uint8Array);
|
|
9
|
+
return btoa(binaryString);
|
|
11
10
|
}
|
|
12
11
|
function base64Decode(str) {
|
|
13
|
-
|
|
12
|
+
const binaryString = atob(str);
|
|
13
|
+
const binaryArray = Uint8Array.from(binaryString, (char) => char.charCodeAt(0));
|
|
14
|
+
const decoder = new TextDecoder();
|
|
15
|
+
return decoder.decode(binaryArray);
|
|
14
16
|
}
|
|
15
17
|
//# sourceMappingURL=base64.js.map
|
package/dist/lib/base64.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src/lib/base64.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"base64.js","sourceRoot":"","sources":["../../src/lib/base64.ts"],"names":[],"mappings":";;AAAA,oCAKC;AAED,oCAKC;AAZD,SAAgB,YAAY,CAAC,GAAW;IACtC,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,MAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC,GAAG,UAAU,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC,YAAY,CAAC,CAAC;AAC5B,CAAC;AAED,SAAgB,YAAY,CAAC,GAAW;IACtC,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/B,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAChF,MAAM,OAAO,GAAG,IAAI,WAAW,EAAE,CAAC;IAClC,OAAO,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACrC,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const LIB_VERSION = "0.4.0-aplha.
|
|
1
|
+
export declare const LIB_VERSION = "0.4.0-aplha.6";
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
package/src/lib/base64.ts
CHANGED
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import isNodejs from './isNodejs';
|
|
2
|
-
|
|
3
1
|
export function base64Encode(str: string): string {
|
|
4
|
-
|
|
2
|
+
const encoder = new TextEncoder();
|
|
3
|
+
const uint8Array = encoder.encode(str);
|
|
4
|
+
const binaryString = String.fromCharCode(...uint8Array);
|
|
5
|
+
return btoa(binaryString);
|
|
5
6
|
}
|
|
6
7
|
|
|
7
8
|
export function base64Decode(str: string): string {
|
|
8
|
-
|
|
9
|
+
const binaryString = atob(str);
|
|
10
|
+
const binaryArray = Uint8Array.from(binaryString, (char) => char.charCodeAt(0));
|
|
11
|
+
const decoder = new TextDecoder();
|
|
12
|
+
return decoder.decode(binaryArray);
|
|
9
13
|
}
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const LIB_VERSION = "0.4.0-aplha.
|
|
1
|
+
export const LIB_VERSION = "0.4.0-aplha.6";
|