Closed elisherer closed 7 years ago
I used postcss-url as-is no custom options (not passing an options object). Now i'm required to pass an empty object because otherwise I fail an options.url check as soon as replaceUrl is called in the index.js file.
options.url
replaceUrl
index.js
plugin:
module.exports = postcss.plugin('postcss-url', (options) => ... return declProcessor(options, result, dir, decl); ... );
declProcessor:
const declProcessor = (options, result, dir, decl) => { ... const newUrl = replaceUrl(url, dir, options, result, decl); ... };
replaceUrl:
const replaceUrl = (url, dir, options, result, decl) => { const isFunction = typeof options.url === 'function'; ^ fails here! ... };
I think a simple
module.exports = postcss.plugin('postcss-url', (options = {}) =>
should solve it.
@elisherer thanks for feedback, now i will fix it
@elisherer done!
I used postcss-url as-is no custom options (not passing an options object). Now i'm required to pass an empty object because otherwise I fail an
options.url
check as soon asreplaceUrl
is called in theindex.js
file.plugin:
declProcessor:
replaceUrl:
I think a simple
should solve it.