msgpackr 1.11.5 → 1.11.6

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/index.js CHANGED
@@ -1276,7 +1276,8 @@
1276
1276
  hasSharedUpdate = false;
1277
1277
  let encodingError;
1278
1278
  try {
1279
- if (packr.randomAccessStructure && value && value.constructor && value.constructor === Object)
1279
+ if (packr.randomAccessStructure && value && value.constructor && (value.constructor === Object ||
1280
+ (value.constructor !== Map && !Array.isArray(value) && !extensionClasses.some(extClass => value instanceof extClass))))
1280
1281
  writeStruct(value);
1281
1282
  else
1282
1283
  pack(value);