Skip to content

Commit

Permalink
Remove dead code
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 23, 2022
1 parent dc7cdf9 commit 9c66077
Showing 1 changed file with 8 additions and 30 deletions.
38 changes: 8 additions & 30 deletions src/config/normalize/prop_path/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,29 +8,21 @@ export const list = function (target, query) {
}

const normalizeEntry = function ({ value, path }) {
const query = getEntryQuery({ path })
const query = getEntryQuery(path)
return [query, value]
}

// Same but only retrieving the values
export const getValues = function (target, query) {
const entries = listEntries(target, query)
return entries.map(getEntryValue)
}

const getEntryValue = function ({ value }) {
return value
const getEntryQuery = function (path) {
const entryPath = getEntryPath(path)
return serializeQuery(entryPath)
}

// Same but only retrieving the queries
export const getQueries = function (target, query) {
const entries = listEntries(target, query)
return entries.map(getEntryQuery)
const getEntryPath = function (path) {
return path.map(getPathKey)
}

const getEntryQuery = function ({ path }) {
const entryPath = getEntryPath({ path })
return serializeQuery(entryPath)
const getPathKey = function ({ key }) {
return key
}

const serializeQuery = function (entryPath) {
Expand All @@ -44,17 +36,3 @@ const appendKey = function (pathStr, key) {

return pathStr === '' ? `${pathStr}${key}` : `${pathStr}.${key}`
}

// Same but only retrieving the paths
export const getPaths = function (target, query) {
const entries = listEntries(target, query)
return entries.map(getEntryPath)
}

const getEntryPath = function ({ path }) {
return path.map(getPathKey)
}

const getPathKey = function ({ key }) {
return key
}

0 comments on commit 9c66077

Please sign in to comment.