Skip to content

Commit

Permalink
Renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jan 23, 2022
1 parent 86fd97e commit b8ce99e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/config/normalize/prop_path/compare.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { parseQuery } from './parse.js'
import { parse } from './parse.js'

// Returns whether a query is a parent to another one, such as `a.b` and `a.b.c`
// Wildcards always match, i.e. `a.*` is a parent to `a.b.c` and
// `a.b` is a parent to `a.*.c`.
export const isParent = function (childQuery, parentQuery) {
const childTokens = parseQuery(childQuery)
const parentTokens = parseQuery(parentQuery)
const childTokens = parse(childQuery)
const parentTokens = parse(parentQuery)
return (
parentTokens.length < childTokens.length &&
parentTokens.every((parentToken, index) =>
Expand Down
4 changes: 2 additions & 2 deletions src/config/normalize/prop_path/entries.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import isPlainObj from 'is-plain-obj'

import { parseQuery } from './parse.js'
import { parse } from './parse.js'

// List all values (and their associated path) matching a specific query for
// on specific target value.
export const listEntries = function (target, query) {
const tokens = parseQuery(query)
const tokens = parse(query)
return tokens.reduce(listTokenEntries, [{ value: target, path: [] }])
}

Expand Down
2 changes: 1 addition & 1 deletion src/config/normalize/prop_path/parse.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
// or arrays will be created if undefined.
// TODO: allow special characters (like dots), if escaped with backslash
// TODO: do not recurse over `__proto__`, `prototype` or `constructor`
export const parseQuery = function (query) {
export const parse = function (query) {
const normalizedQuery = prependDot(query)
const matchResults = [...normalizedQuery.matchAll(QUERY_REGEXP)]
validateQuery(matchResults, query, normalizedQuery)
Expand Down

0 comments on commit b8ce99e

Please sign in to comment.