endpoints/endpoints

View on GitHub
es5/store-bookshelf/lib/serialize.js

Summary

Maintainability
A
0 mins
Test Coverage
/**
 * Return the provided model as JSON. We specify shallow here so
 * that relations are not automatically nested in the response.
 *
 * @param {Bookshelf.Model} model
 * @return {Object}
 */
"use strict";

exports.__esModule = true;
exports["default"] = serialize;

function serialize(model) {
  return model.toJSON({ shallow: true });
}

module.exports = exports["default"];