Skip to content

Commit 7442ef9

Browse files
author
Alexandru Badiu
committed
fix(converters): Fix default param in converters
Fixed the default parameter assigment in converters that was crashing in ES5.
1 parent 5cf61eb commit 7442ef9

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Node image generation module based on [sharp](https://github.com/lovell/sharp) a
1717

1818
```
1919
import presets from './presets';
20-
import ImageCache from 'imagecache';
20+
import ImageCache from 'imagecache-sharp';
2121
2222
const imagecache = new ImageCache(presets);
2323

dist/plugins/_converters.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ module.exports = {
2323
return converted;
2424
};
2525

26-
app.actions.convertPosition = (value, maxPosition, imageSize = 0) => {
26+
app.actions.convertPosition = (value, maxPosition, imageSize) => {
2727
let converted;
2828

29+
imageSize = imageSize || 0;
30+
2931
if (value === 'left' || value === 'top') {
3032
converted = 0;
3133
} else if (value === 'center') {

src/plugins/_converters.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,11 @@ module.exports = {
2121
return converted;
2222
};
2323

24-
app.actions.convertPosition = (value, maxPosition, imageSize = 0) => {
24+
app.actions.convertPosition = (value, maxPosition, imageSize) => {
2525
let converted;
2626

27+
imageSize = imageSize || 0;
28+
2729
if (value === 'left' || value === 'top') {
2830
converted = 0;
2931
} else if (value === 'center') {

0 commit comments

Comments
 (0)