@kitware/vtk.js 28.12.3 → 28.12.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.
- package/macros2.js +5 -0
- package/package.json +1 -1
package/macros2.js
CHANGED
|
@@ -154,6 +154,9 @@ function safeArrays(model) {
|
|
|
154
154
|
}
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
+
function isTypedArray(value) {
|
|
158
|
+
return Object.values(TYPED_ARRAYS).some(ctor => value instanceof ctor);
|
|
159
|
+
}
|
|
157
160
|
|
|
158
161
|
// ----------------------------------------------------------------------------
|
|
159
162
|
// shallow equals
|
|
@@ -346,6 +349,8 @@ function obj() {
|
|
|
346
349
|
jsonArchive[keyName] = jsonArchive[keyName].getState();
|
|
347
350
|
} else if (Array.isArray(jsonArchive[keyName])) {
|
|
348
351
|
jsonArchive[keyName] = jsonArchive[keyName].map(getStateArrayMapFunc);
|
|
352
|
+
} else if (isTypedArray(jsonArchive[keyName])) {
|
|
353
|
+
jsonArchive[keyName] = Array.from(jsonArchive[keyName]);
|
|
349
354
|
}
|
|
350
355
|
});
|
|
351
356
|
|