@vite-plugin-opencode-assistant/shared 1.0.40 → 1.0.42
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/es/utils.js +3 -0
- package/lib/utils.js +3 -0
- package/package.json +1 -1
package/es/utils.js
CHANGED
|
@@ -30,6 +30,9 @@ function sleep(ms) {
|
|
|
30
30
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
31
31
|
}
|
|
32
32
|
function base64Encode(str) {
|
|
33
|
+
if (!str) {
|
|
34
|
+
throw new Error("base64Encode: input string is required");
|
|
35
|
+
}
|
|
33
36
|
if (typeof Buffer !== "undefined") {
|
|
34
37
|
return Buffer.from(str).toString("base64");
|
|
35
38
|
}
|
package/lib/utils.js
CHANGED
|
@@ -67,6 +67,9 @@ function sleep(ms) {
|
|
|
67
67
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
68
68
|
}
|
|
69
69
|
function base64Encode(str) {
|
|
70
|
+
if (!str) {
|
|
71
|
+
throw new Error("base64Encode: input string is required");
|
|
72
|
+
}
|
|
70
73
|
if (typeof Buffer !== "undefined") {
|
|
71
74
|
return Buffer.from(str).toString("base64");
|
|
72
75
|
}
|