Skip to content

Commit

Permalink
take production flag in gather-dependency-versions
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Feb 21, 2019
1 parent f50c226 commit e240c37
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions functions/recursors/gather-dependency-versions.js
Expand Up @@ -3,12 +3,15 @@ import fastclone from "fast-clone"

export let initial = {}

export let createReducer = () =>
export let createReducer = ({production = false} = {}) =>
function reducer (current, name, info) {
if (production && info.dev) {
return current
}
let counts = fastclone(current)
counts[name] = [...new Set((counts[name] || []).concat(info.version))]
return counts
}

let recursor = () => createRecursor(createReducer(), initial)
let recursor = ({production}) => createRecursor(createReducer({production}), initial)
export default recursor

0 comments on commit e240c37

Please sign in to comment.