tIn the process of deserialization, if a class cannot be found, a warning is issued to the console.
Replace it with a function.
deserialize("...", {
loadClass: (name: string): ConstructorType | null | undefined => {
/* find class name */
const class = findClass(name)
if (!class) {
console.warn(`Class ${name} is not defined. It will be ignored.`);
}
return class
}
})
default loadClass
const defaultLoadClass = (name: string): ConstructorType | null | undefined => {
console.warn(`Class ${name} is not defined. It will be ignored.`);
}
tIn the process of deserialization, if a class cannot be found, a warning is issued to the console.
Replace it with a function.
default
loadClass