Use Lodash omit
instead of delete
This commit is contained in:
parent
ef2be2cf5f
commit
2ad0fd7db6
1 changed files with 5 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
||||||
const isArrayBuffer = require('lodash/isArrayBuffer');
|
const isArrayBuffer = require('lodash/isArrayBuffer');
|
||||||
const isFunction = require('lodash/isFunction');
|
const isFunction = require('lodash/isFunction');
|
||||||
const isUndefined = require('lodash/isUndefined');
|
const isUndefined = require('lodash/isUndefined');
|
||||||
|
const omit = require('lodash/omit');
|
||||||
|
|
||||||
|
|
||||||
// type Context :: {
|
// type Context :: {
|
||||||
|
@ -31,7 +32,9 @@ exports.migrateDataToFileSystem = async (attachment, { writeAttachmentData } = {
|
||||||
|
|
||||||
const path = await writeAttachmentData(data);
|
const path = await writeAttachmentData(data);
|
||||||
|
|
||||||
const attachmentWithoutData = Object.assign({}, attachment, { path });
|
const attachmentWithoutData = omit(
|
||||||
delete attachmentWithoutData.data;
|
Object.assign({}, attachment, { path }),
|
||||||
|
['data']
|
||||||
|
);
|
||||||
return attachmentWithoutData;
|
return attachmentWithoutData;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue