Skip to content

Commit

Permalink
Fix list()
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 6, 2022
1 parent 1b151f0 commit c097746
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/config/normalize/lib/star_dot_path/entries.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const handleMissingValue = function (value, token) {
}

// Compute all entries properties from the basic ones
export const normalizeEntry = function ({ value, path }) {
export const normalizeEntry = function ({ value, path, missing }) {
const query = serialize(path)
return { value, path, query }
return { value, path, query, missing }
}
4 changes: 3 additions & 1 deletion src/config/normalize/lib/star_dot_path/get.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import { listEntries, normalizeEntry } from './entries.js'

// Retrieve all properties in `target` matching a query string.
// Unlike `get|has()` it also return missing entries, letting consumers filter
// them or not.
export const list = function (target, queryOrPath) {
const entries = listExistingEntries(target, queryOrPath)
const entries = listEntries(target, queryOrPath)
return entries.map(normalizeEntry)
}

Expand Down

0 comments on commit c097746

Please sign in to comment.