const {
Smykowski,
defaultEncoders,
defaultDecoders,
classSerializer
} = require("smykowski@1.2.0");
class Person {
constructor(first, last) {
this.first = first;
this.last = last;
}
getFullname() {
return this.first + ' ' + this.last;
}
}
class Employee extends Person {
constructor(first, last) {
super(first, last);
this.id = NaN;
}
}
const ajson = new Smykowski()
.use(classSerializer, { Person, Employee })
.use(defaultEncoders)
.use(defaultDecoders);