@ima/plugin-rest-client
Version:
Generic REST API client plugin for the IMA application framework.
41 lines (40 loc) • 1.3 kB
JavaScript
/**
* Decorator for setting the static {@code dataFieldMapping} property of an
* entity class, which specifies the automatic mapping of raw entity data to
* entity properties.
*
* @param {Object<string, (
* string|
* function(new: AbstractDataFieldMapper)|
* {
* dataFieldName: ?string,
* deserialize: function(*, AbstractEntity): *,
* serialize: function(*, AbstractEntity): *
* }
* )>} dataFieldMapping The descriptor of how the entity data
* should be mapped to the entity's properties.
* @returns {function(function(
* new: AbstractEntity,
* RestClient,
* Object<string, *>,
* ?AbstractEntity=
* ))} Callback that sets the data field mapping on the provided entity
* class.
*/ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "default", {
enumerable: true,
get: function() {
return _default;
}
});
const _default = (dataFieldMapping)=>{
return (classConstructor)=>{
Object.defineProperty(classConstructor, 'dataFieldMapping', {
value: dataFieldMapping
});
};
};
//# sourceMappingURL=dataFieldMapping.js.map