Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
feat!: remove options (fastcrush, maxmemory, notrellis, noovershoot)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaharu committed Apr 24, 2020
1 parent 03f1abd commit 4fcc153
Showing 1 changed file with 2 additions and 18 deletions.
20 changes: 2 additions & 18 deletions index.js
Expand Up @@ -4,11 +4,9 @@ const isJpg = require('is-jpg');
const mozjpeg = require('mozjpeg');

module.exports = options => buffer => {
options = Object.assign({
trellis: true,
options = {trellis: true,
trellisDC: true,
overshoot: true
}, options);
overshoot: true, ...options};

if (!Buffer.isBuffer(buffer)) {
return Promise.reject(new TypeError('Expected a buffer'));
Expand All @@ -18,20 +16,6 @@ module.exports = options => buffer => {
return Promise.resolve(buffer);
}

// TODO: Remove these sometime far in the future
if (options.fastcrush) {
return Promise.reject(new Error('Option `fastcrush` was renamed to `fastCrush`'));
}
if (options.maxmemory) {
return Promise.reject(new Error('Option `maxmemory` was renamed to `maxMemory`'));
}
if (options.notrellis) {
return Promise.reject(new Error('Option `notrellis` was renamed to `trellis` and inverted'));
}
if (options.noovershoot) {
return Promise.reject(new Error('Option `noovershoot` was renamed to `overshoot` and inverted'));
}

const args = [];

if (typeof options.quality !== 'undefined') {
Expand Down

0 comments on commit 4fcc153

Please sign in to comment.