Skip to content

Commit

Permalink
Updated the variable name making it clearer
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hewitt committed Jan 13, 2018
1 parent 829b1f2 commit 4b94bbf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/gatsby-source-wordpress/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ plugins: [
// It can help you debug specific API Endpoints problems
verboseOutput: false,
// Search and Replace Urls across WordPress content
searchAndReplaceURLs: {
searchAndReplaceContentUrls: {
sourceUrl: "https://source-url.com",
replacementUrl: "https://replacement-url.com"
}
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-source-wordpress/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ exports.sourceNodes = async (
auth = {},
verboseOutput,
perPage = 100,
searchAndReplaceURLs = {},
searchAndReplaceContentUrls = {},
}
) => {
const { createNode } = boundActionCreators
Expand Down Expand Up @@ -96,7 +96,7 @@ exports.sourceNodes = async (
// Search and replace Content Urls
entities = normalize.searchReplaceContentUrls({
entities,
searchAndReplaceURLs,
searchAndReplaceContentUrls,
})

// creates nodes for each entry
Expand Down
14 changes: 7 additions & 7 deletions packages/gatsby-source-wordpress/src/normalize.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,19 @@ exports.mapTagsCategoriesToTaxonomies = entities =>
return e
})

exports.searchReplaceContentUrls = function ({ entities, searchAndReplaceURLs }) {
exports.searchReplaceContentUrls = function ({ entities, searchAndReplaceContentUrls }) {

if (
!(_.isPlainObject(searchAndReplaceURLs)) ||
!(_.has(searchAndReplaceURLs, `sourceUrl`)) ||
!(_.has(searchAndReplaceURLs, `replacementUrl`)) ||
typeof searchAndReplaceURLs.sourceUrl !== `string` ||
typeof searchAndReplaceURLs.replacementUrl !== `string`
!(_.isPlainObject(searchAndReplaceContentUrls)) ||
!(_.has(searchAndReplaceContentUrls, `sourceUrl`)) ||
!(_.has(searchAndReplaceContentUrls, `replacementUrl`)) ||
typeof searchAndReplaceContentUrls.sourceUrl !== `string` ||
typeof searchAndReplaceContentUrls.replacementUrl !== `string`
) {
return entities
}

const { sourceUrl, replacementUrl } = searchAndReplaceURLs
const { sourceUrl, replacementUrl } = searchAndReplaceContentUrls

const _blacklist = [
`_links`,
Expand Down

0 comments on commit 4b94bbf

Please sign in to comment.