If you use an object that contains a buffer (for example _id coming from MongoDB), calling methods like toString crash with the error "TypeError: argument must be a buffer".
Here is a test that verifies this:
it("Proxied Buffer.toString outputs the pristine Buffer.toString", async (assert) => {
const model = { id: Buffer.from("5fea9621e6efdf282752f5ba") };
const proxy = ObservableSlim.create(model);
expect(proxy.id.toString()).to.equal(model.id.toString())
});
If you use an object that contains a buffer (for example _id coming from MongoDB), calling methods like
toStringcrash with the error "TypeError: argument must be a buffer".Here is a test that verifies this: