fix(core): update

This commit is contained in:
2024-03-03 10:29:18 +01:00
parent 45593168b0
commit d77c104915
7 changed files with 197 additions and 63 deletions

View File

@ -61,12 +61,15 @@ tap.test('stringify should handle plain string', async () => {
tap.test('should work with buffers', async () => {
const someObject = {
myBuffer: Buffer.from('hello'),
myBuffer: new TextEncoder().encode('hello')
};
console.log(someObject.myBuffer);
const stringified = smartjson.stringify(someObject);
console.log(stringified);
const decoded = smartjson.parse(stringified);
expect(decoded.myBuffer.toString()).toEqual('hello');
console.log(decoded.myBuffer);
let text = new TextDecoder().decode(decoded.myBuffer);
expect(text).toEqual('hello');
});
tap.start();