Skip to content

Commit

Permalink
Start removing complex nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 6, 2022
1 parent 929dc0c commit 19ff52b
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 71 deletions.
62 changes: 0 additions & 62 deletions src/config/normalize/lib/star_dot_path/entries/complex.js

This file was deleted.

9 changes: 0 additions & 9 deletions src/config/normalize/lib/star_dot_path/entries/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { convertIndexInteger, convertIndexString } from '../parsing/path.js'
import { serialize } from '../parsing/serialize.js'
import { ANY_TOKEN } from '../parsing/special.js'

import { getComplexEntries } from './complex.js'
import { isRecurseObject } from './recurse.js'

// List all values (and their associated path) matching a specific query for
Expand All @@ -16,20 +15,12 @@ const listNodeEntries = function (entries, node) {
}

const getNodeEntries = function ({ value, path }, node) {
if (isComplexNode(node)) {
return getComplexEntries(value, path, node)
}

const token = Array.isArray(node) ? node[0] : node
return token === ANY_TOKEN
? getAnyEntries(value, path)
: getKeyEntries(value, path, token)
}

const isComplexNode = function (node) {
return Array.isArray(node) && node.length > 1
}

// For queries which use * on its own, e.g. `a.*`
const getAnyEntries = function (value, path) {
if (Array.isArray(value)) {
Expand Down

0 comments on commit 19ff52b

Please sign in to comment.