Skip to content

Commit

Permalink
simplify and fix
Browse files Browse the repository at this point in the history
Signed-off-by: Haroen Viaene <[email protected]>
  • Loading branch information
Haroenv committed Apr 11, 2018
1 parent 77ed9a7 commit 982f9e1
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/gatsby-source-npm-package-search/src/gatsby-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,15 @@ exports.sourceNodes = async (

console.log(`Grabbing local NPM packages...`)

let buildFilter = []
const buildFilter = keywords.map(keyword => `keywords:${keyword}`)

keywords.forEach(keyword => {
buildFilter.push(`keywords:${keyword}`)
})

const data = await browse({
const hits = await browse({
index,
filters: `(${buildFilter.join(` OR `)})`,
hitsPerPage: 1000,
})

data.hits.forEach(hit => {
hits.forEach(hit => {
// commented changed remove all badges and images from readme content to keep the creation of the node from failing below
// if (hit.readme.includes(`![`)) {
// hit.readme = hit.readme.replace(/[[]?!\[.*\b/gi, ``)
Expand Down

0 comments on commit 982f9e1

Please sign in to comment.