@yorkie-js/react 0.6.21 → 0.6.22
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/yorkie-js-react.js
CHANGED
|
@@ -7,7 +7,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
7
7
|
|
|
8
8
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
9
9
|
const name$1 = "@yorkie-js/react";
|
|
10
|
-
const version$1 = "0.6.
|
|
10
|
+
const version$1 = "0.6.22";
|
|
11
11
|
const pkg$1 = {
|
|
12
12
|
name: name$1,
|
|
13
13
|
version: version$1
|
|
@@ -16178,7 +16178,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
16178
16178
|
}
|
|
16179
16179
|
const pbVector = new VersionVector$1();
|
|
16180
16180
|
for (const [actorID, lamport] of vector) {
|
|
16181
|
-
|
|
16181
|
+
const base64ActorID = uint8ArrayToBase64(toUint8Array(actorID));
|
|
16182
|
+
pbVector.vector[base64ActorID] = BigInt(lamport.toString());
|
|
16182
16183
|
}
|
|
16183
16184
|
return pbVector;
|
|
16184
16185
|
}
|
|
@@ -16676,7 +16677,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
16676
16677
|
}
|
|
16677
16678
|
const vector = new VersionVector();
|
|
16678
16679
|
Object.entries(pbVersionVector.vector).forEach(([key, value]) => {
|
|
16679
|
-
|
|
16680
|
+
const hexKey = bytesToHex(base64ToUint8Array(key));
|
|
16681
|
+
vector.set(hexKey, BigInt(value.toString()));
|
|
16680
16682
|
});
|
|
16681
16683
|
return vector;
|
|
16682
16684
|
}
|
|
@@ -17204,9 +17206,39 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
17204
17206
|
hex.match(/.{1,2}/g).map((byte) => parseInt(byte, 16))
|
|
17205
17207
|
);
|
|
17206
17208
|
}
|
|
17209
|
+
function base64ToUint8Array(base64) {
|
|
17210
|
+
if (typeof window !== "undefined" && typeof window.atob === "function") {
|
|
17211
|
+
const binary = window.atob(base64);
|
|
17212
|
+
const len = binary.length;
|
|
17213
|
+
const bytes = new Uint8Array(len);
|
|
17214
|
+
for (let i = 0; i < len; i++) {
|
|
17215
|
+
bytes[i] = binary.charCodeAt(i);
|
|
17216
|
+
}
|
|
17217
|
+
return bytes;
|
|
17218
|
+
} else if (typeof globalThis !== "undefined" && typeof globalThis.Buffer !== "undefined") {
|
|
17219
|
+
const Buffer2 = globalThis.Buffer;
|
|
17220
|
+
return new Uint8Array(Buffer2.from(base64, "base64"));
|
|
17221
|
+
} else {
|
|
17222
|
+
throw new Error("No base64 decoder available");
|
|
17223
|
+
}
|
|
17224
|
+
}
|
|
17207
17225
|
function toUint8Array(hex) {
|
|
17208
17226
|
return hexToBytes(hex);
|
|
17209
17227
|
}
|
|
17228
|
+
function uint8ArrayToBase64(bytes) {
|
|
17229
|
+
if (typeof window !== "undefined" && typeof window.btoa === "function") {
|
|
17230
|
+
let binary = "";
|
|
17231
|
+
for (let i = 0; i < bytes.byteLength; i++) {
|
|
17232
|
+
binary += String.fromCharCode(bytes[i]);
|
|
17233
|
+
}
|
|
17234
|
+
return window.btoa(binary);
|
|
17235
|
+
} else if (typeof globalThis !== "undefined" && typeof globalThis.Buffer !== "undefined") {
|
|
17236
|
+
const Buffer2 = globalThis.Buffer;
|
|
17237
|
+
return Buffer2.from(bytes).toString("base64");
|
|
17238
|
+
} else {
|
|
17239
|
+
throw new Error("No base64 encoder available");
|
|
17240
|
+
}
|
|
17241
|
+
}
|
|
17210
17242
|
function bytesToChangeID(bytes) {
|
|
17211
17243
|
const pbChangeID = ChangeID$1.fromBinary(bytes);
|
|
17212
17244
|
return fromChangeID(pbChangeID);
|
|
@@ -21266,7 +21298,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
21266
21298
|
};
|
|
21267
21299
|
}
|
|
21268
21300
|
const name = "@yorkie-js/sdk";
|
|
21269
|
-
const version = "0.6.
|
|
21301
|
+
const version = "0.6.22";
|
|
21270
21302
|
const pkg = {
|
|
21271
21303
|
name,
|
|
21272
21304
|
version
|