Skip to content

Commit 491e5df

Browse files
committed
v.6.0.1 - fixed: bug with empty options
1 parent eee4ad4 commit 491e5df

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 6.0.1 - 2017-04-03
2+
- Fixed: bug with empty options
3+
([#87](https://github.com/postcss/postcss-url/issues/87))
4+
15
# 6.0.0 - 2017-04-02
26

37
- Changed: es5 -> es6

src/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ const declProcessor = (options, result, dir, decl) => {
102102
*
103103
* @type {Plugin}
104104
*/
105-
module.exports = postcss.plugin('postcss-url', (options) =>
106-
function(styles, result) {
105+
module.exports = postcss.plugin('postcss-url', (options) => {
106+
options = options || {};
107+
108+
return function(styles, result) {
107109
const opts = result.opts;
108110
const from = opts.from ? path.dirname(opts.from) : '.';
109111
const to = opts.to ? path.dirname(opts.to) : from;
@@ -114,7 +116,7 @@ module.exports = postcss.plugin('postcss-url', (options) =>
114116
return declProcessor(options, result, dir, decl);
115117
});
116118
}
117-
);
119+
});
118120

119121
/**
120122
* @callback PostcssUrl~UrlProcessor

test/type/rebase.js

+8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
describe('rebase', () => {
22
const opts = {};
33

4+
it('rebase with empty options', () => {
5+
processedCss(
6+
'fixtures/copy-hash',
7+
undefined,
8+
{ from: 'test/fixtures/here' }
9+
).css;
10+
});
11+
412
compareFixtures(
513
'cant-rebase',
614
'shouldn\'t rebase url if not info available');

0 commit comments

Comments
 (0)