Skip to content

Commit

Permalink
fix: do not augment plugin-options (#26006)
Browse files Browse the repository at this point in the history
  • Loading branch information
wardpeet authored Jul 24, 2020
1 parent 1b16e07 commit 222920b
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-sharp/src/trace-svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ exports.notMemoizedtraceSVG = async ({ file, args, fileArgs, reporter }) => {
turnPolicy: potrace.Potrace.TURNPOLICY_MAJORITY,
}

const optionsSVG = _.defaults(args, defaultArgs)
const optionsSVG = _.defaults({}, args, defaultArgs)

// `srcset` attribute rejects URIs with literal spaces
const encodeSpaces = str => str.replace(/ /gi, `%20`)
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-remark-copy-linked-files/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module.exports = (
if (!validateDestinationDir(destinationDir))
return Promise.reject(invalidDestinationDirMessage(destinationDir))

const options = _.defaults(pluginOptions, defaults)
const options = _.defaults({}, pluginOptions, defaults)

const filesToCopy = new Map()
// Copy linked files to the destination directory and modify the AST to point
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-remark-images-contentful/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ module.exports = async (

const srcSplit = node.url.split(`/`)
const fileName = srcSplit[srcSplit.length - 1]
const options = _.defaults(pluginOptions, defaults)
const options = _.defaults({}, pluginOptions, defaults)

const optionsHash = createContentDigest(options)

Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-remark-images/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = (
},
pluginOptions
) => {
const options = _.defaults(pluginOptions, { pathPrefix }, DEFAULT_OPTIONS)
const options = _.defaults({}, pluginOptions, { pathPrefix }, DEFAULT_OPTIONS)

const findParentLinks = ({ children }) =>
children.some(
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-remark-responsive-iframe/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ module.exports = async ({ markdownAST }, pluginOptions = {}) => {
const defaults = {
wrapperStyle: ``,
}
const options = _.defaults(pluginOptions, defaults)
const options = _.defaults({}, pluginOptions, defaults)
visit(markdownAST, [`html`, `jsx`], node => {
const $ = cheerio.load(node.value)
const iframe = $(`iframe, object`)
Expand Down

0 comments on commit 222920b

Please sign in to comment.