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
- const enc = new TextEncoder();
161
- return enc.encode(str);
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
- const dec = new TextDecoder();
166
- return dec.decode(bytes);
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "core-3nweb-client-lib",
3
- "version": "0.28.3",
3
+ "version": "0.28.4",
4
4
  "description": "3NWeb client core library, embeddable into different environments",
5
5
  "main": "build/lib-index.js",
6
6
  "types": "build/lib-index.d.ts",