Sharkey/src/api/serializers/signin.ts

26 lines
395 B
TypeScript
Raw Normal View History

2016-12-29 00:49:51 +02:00
'use strict';
/**
* Module dependencies
*/
2017-01-02 23:03:19 +02:00
import deepcopy = require('deepcopy');
2016-12-29 00:49:51 +02:00
/**
* 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);
});