UNPKG

node-fractal

Version:

Output complex, flexible, AJAX/RESTful data structures.

28 lines 694 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DataSerializer = void 0; const lodash_1 = require("lodash"); class DataSerializer { mergeIncludes(transformedData, includedData) { return Object.assign(Object.assign({}, transformedData), includedData); } collection(resourceKey, data) { return { data: data, }; } item(resourceKey, data) { return data; } null() { return {}; } meta(meta) { if ((0, lodash_1.isEmpty)(meta)) { return {}; } return { meta }; } } exports.DataSerializer = DataSerializer; //# sourceMappingURL=data.js.map