Skip to content

Commit a35173e

Browse files
committed
Deep cloning of cluster properties. Closes #215
1 parent fff7326 commit a35173e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,11 @@ export default class Supercluster {
369369
_map(data, i, clone) {
370370
if (data[i + OFFSET_NUM] > 1) {
371371
const props = this.clusterProps[data[i + OFFSET_PROP]];
372-
return clone ? Object.assign({}, props) : props;
372+
return clone ? structuredClone(props) : props;
373373
}
374374
const original = this.points[data[i + OFFSET_ID]].properties;
375375
const result = this.options.map(original);
376-
return clone && result === original ? Object.assign({}, result) : result;
376+
return clone && result === original ? structuredClone(result) : result;
377377
}
378378
}
379379

0 commit comments

Comments
 (0)