Add Attachment.removeSchemaVersion

This commit is contained in:
Daniel Gasienica 2018-03-13 21:27:28 -04:00
parent 37d35db3c3
commit 3dfc823716
2 changed files with 28 additions and 0 deletions

View file

@ -176,6 +176,12 @@ exports._replaceUnicodeOrderOverridesSync = (attachment) => {
exports.replaceUnicodeOrderOverrides = async attachment =>
exports._replaceUnicodeOrderOverridesSync(attachment);
exports.removeSchemaVersion = async (attachment) => {
const attachmentWithoutSchemaVersion = Object.assign({}, attachment);
delete attachmentWithoutSchemaVersion.schemaVersion;
return attachmentWithoutSchemaVersion;
};
// Public API
const toVersion1 = exports.withSchemaVersion(1, autoOrientJPEG);
const toVersion2 = exports.withSchemaVersion(2, exports.replaceUnicodeOrderOverrides);