Skip to content

Commit ac66e45

Browse files
authored
Merge pull request #2294 from dexie/liz/fix-sortby-immutable-cache
fix: Collection.sortBy() throws on frozen arrays in immutable cache mode
2 parents 97f9942 + 07e45e5 commit ac66e45

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/classes/collection/collection.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ export class Collection implements ICollection {
195195
return cmp(aVal, bVal) * order;
196196
}
197197
return this.toArray(function (a) {
198-
return a.sort(sorter);
198+
return a.slice().sort(sorter);
199199
}).then(cb);
200200
}
201201

0 commit comments

Comments
 (0)