mirror of
https://iceshrimp.dev/limepotato/jormungandr-bite.git
synced 2024-11-18 16:07:31 -07:00
ac225d4ea6
Closes #12, #227 and #58
23 lines
371 B
TypeScript
23 lines
371 B
TypeScript
/**
|
|
* Module dependencies
|
|
*/
|
|
import deepcopy = require('deepcopy');
|
|
|
|
/**
|
|
* Serialize a signin record
|
|
*
|
|
* @param {any} record
|
|
* @return {Promise<any>}
|
|
*/
|
|
export default (
|
|
record: any
|
|
) => new Promise<any>(async (resolve, reject) => {
|
|
|
|
const _record = deepcopy(record);
|
|
|
|
// Rename _id to id
|
|
_record.id = _record._id;
|
|
delete _record._id;
|
|
|
|
resolve(_record);
|
|
});
|