Open VasilisTert opened 1 year ago
Until this PR is merged (never, I guess), this monkeypatch can be a viable solution:
// TypeScript
import LokiJS from 'lokijs';
// Make Resultset.disableFreeze a property with getter that returns Collection.disableFreeze property value.
Object.defineProperty((LokiJS as any).Resultset.prototype, 'disableFreeze', {
get() {
return this.collection.disableFreeze;
},
});
The flag
disableFreeze
is incollection
not inthis
. Now it returnsundefined
so the object is always cloned.