Skip to content

Commit 5fcdc0a

Browse files
committed
The start to some serialisation functions
1 parent d27439b commit 5fcdc0a

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/serialisation.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import ServiceObj from '../lib/service-obj.js';
2+
3+
let original = new ServiceObj({name: 'steve'});
4+
5+
let a1 = structuredClone(original);
6+
let b1 = {...original};
7+
let c1 = Object.entries(original);
8+
9+
let a2 = structuredClone(original.toObject());
10+
let b2 = {...original.toObject()};
11+
let c2 = Object.entries(original.toObject());
12+
13+
console.debug('What have we got?', {original, jsonCloned: JSON.parse(JSON.stringify(original)), fromOriginal: {a1, b1, c1}, fromToObjected: {a2, b2, c2}, string: original.toString()});

0 commit comments

Comments
 (0)