Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Mar 6, 2022
1 parent 1cd3e78 commit ba3a6bd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/config/normalize/lib/star_dot_path/parsing/compare.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,15 @@ export const equals = function (queryOrPathA, queryOrPathB) {
)
}

// Check if a query is a parent of another
// Check if a query is a parent of another.
// The comparison is currently token type-wise, i.e.:
// - * does not match other token types
// - RegExps does not match prop tokens
// - Unions are not resolved
// Also, this is only for the query without any target, i.e.:
// - Negative indices do not match positive indices
// But this works perfectly when only prop and positive indices are used.
// - E.g. on the entries returned by `list()`
export const parent = function (parentQueryOrPath, childQueryOrPath) {
const parentPath = parse(parentQueryOrPath)
const childPath = parse(childQueryOrPath)
Expand Down

0 comments on commit ba3a6bd

Please sign in to comment.