ag-common 0.0.450 → 0.0.451
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.
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.base64ToBinary = exports.arrayBufferToBase64 = void 0;
|
|
3
|
+
exports.base64ToBinary = exports.arrayBufferToBase64 = exports.toBuffer = void 0;
|
|
4
4
|
const base64_1 = require("./string/base64");
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const view = new Uint8Array(ab);
|
|
8
|
-
for (let i = 0; i < buffer.length; ++i) {
|
|
9
|
-
buffer[i] = view[i];
|
|
10
|
-
}
|
|
11
|
-
return buffer;
|
|
12
|
-
}
|
|
5
|
+
const toBuffer = (ab) => Buffer.from(ab);
|
|
6
|
+
exports.toBuffer = toBuffer;
|
|
13
7
|
function toArrayBuffer(base64) {
|
|
14
8
|
const binary_string = (0, base64_1.fromBase64)(base64);
|
|
15
9
|
const len = binary_string.length;
|
|
@@ -39,5 +33,5 @@ exports.arrayBufferToBase64 = arrayBufferToBase64;
|
|
|
39
33
|
* @param raw
|
|
40
34
|
* @returns
|
|
41
35
|
*/
|
|
42
|
-
const base64ToBinary = (raw) => toBuffer(toArrayBuffer(raw));
|
|
36
|
+
const base64ToBinary = (raw) => (0, exports.toBuffer)(toArrayBuffer(raw));
|
|
43
37
|
exports.base64ToBinary = base64ToBinary;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function truncate(str: string
|
|
1
|
+
export declare function truncate(str: string, n: number, ellip: string): string;
|
package/package.json
CHANGED