It basically takes the incoming property value, applies eventual custom serialization or deserialization,
and then sets the property value to the result.
params can be:
a string, if only the name of source property is provided (name property of IMappingOptions).
// basicProperty keeps the same name assert.equal(deserialized.basicProperty, 'value'); // extName became renamedProperty assert.equal(deserialized.renamedProperty, 123); // customProperty became custom, and the string was converted to number assert.equal(deserialized.custom, 456);
constbackendObjectSerialized = mapper.serialize(deserialized); // reverse conversion was performed assert.deepEqual(backendObjectSerialized, backendObject);
The basic decorator for simple properties.
It basically takes the incoming property value, applies eventual custom serialization or deserialization, and then sets the property value to the result.
params
can be:name
property of IMappingOptions).Usage examples: