core-3nweb-client-lib 0.28.3 → 0.28.4
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.
|
@@ -157,13 +157,23 @@ function valOfOptAny(valObj) {
|
|
|
157
157
|
}
|
|
158
158
|
exports.valOfOptAny = valOfOptAny;
|
|
159
159
|
function encodeToUtf8(str) {
|
|
160
|
-
|
|
161
|
-
|
|
160
|
+
try {
|
|
161
|
+
const enc = new TextEncoder();
|
|
162
|
+
return enc.encode(str);
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
return buffer_utils_1.utf8.pack(str);
|
|
166
|
+
}
|
|
162
167
|
}
|
|
163
168
|
exports.encodeToUtf8 = encodeToUtf8;
|
|
164
169
|
function decodeFromUtf8(bytes) {
|
|
165
|
-
|
|
166
|
-
|
|
170
|
+
try {
|
|
171
|
+
const dec = new TextDecoder();
|
|
172
|
+
return dec.decode(bytes);
|
|
173
|
+
}
|
|
174
|
+
catch (err) {
|
|
175
|
+
return buffer_utils_1.utf8.open(bytes);
|
|
176
|
+
}
|
|
167
177
|
}
|
|
168
178
|
exports.decodeFromUtf8 = decodeFromUtf8;
|
|
169
179
|
function methodPathFor(objPath, method) {
|