Sharkey/src/api/serializers/signin.ts
Aya Morisawa e52885bfe4
2017-01-03 06:03:19 +09:00

25 lines
395 B
TypeScript

'use strict';
/**
* Module dependencies
*/
import deepcopy = require('deepcopy');
/**
* Serialize a signin record
*
* @param {Object} record
* @return {Promise<Object>}
*/
export default (
record: any
) => new Promise<Object>(async (resolve, reject) => {
const _record = deepcopy(record);
// Rename _id to id
_record.id = _record._id;
delete _record._id;
resolve(_record);
});