Skip to content
This repository has been archived by the owner on Jan 22, 2023. It is now read-only.

Commit

Permalink
Handle one level nested parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
lauriro committed Dec 31, 2022
1 parent 63ba612 commit bbce58f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Expand Up @@ -11,9 +11,9 @@

!function(exports) {
var undef
, selectorRe = /([.#:[])([-\w]+)(?:\((.+?)\)|([~^$*|]?)=(("|')(?:\\.|[^\\])*?\6|[-\w]+))?]?/g
, selectorLastRe = /([\s>+~]*)(?:("|')(?:\\.|[^\\])*?\2|\(.+?\)|~=|[^\s>+~])+$/
, selectorSplitRe = /\s*,\s*(?=(?:[^'"()]|"(?:\\.|[^\\])*?"|'(?:\\.|[^\\])*?'|\(.+?\))+$)/
, selectorRe = /([.#:[])([-\w]+)(?:\(((?:[^()]|\([^)]+\))+?)\)|([~^$*|]?)=(("|')(?:\\.|[^\\])*?\6|[-\w]+))?]?/g
, selectorLastRe = /([\s>+~]*)(?:("|')(?:\\.|[^\\])*?\2|\((?:[^()]|\([^()]+\))+?\)|~=|[^\s>+~])+$/
, selectorSplitRe = /\s*,\s*(?=(?:[^'"()]|"(?:\\.|[^\\"])*?"|'(?:\\.|[^\\'])*?'|\((?:[^()]|\([^()]+\))+?\))+$)/
, selectorCache = {
"": function() {}
}
Expand Down
1 change: 1 addition & 0 deletions test/index.js
Expand Up @@ -268,6 +268,7 @@ describe("selector-lite", function() {
assert.equal(el1.matches("div:not(:only-of-type)"), false)

assert.equal(el1.matches("div:is(:first-child, :last-child)"), true)
assert.equal(el1.matches("div:is(:not(:last-child))"), true)
assert.equal(el1.matches("div:last-child"), false)
assert.equal(el1.matches("div:not(:last-child)"), true)
assert.equal(el1.matches("div:is(:first-child, :last-child)"), true)
Expand Down

0 comments on commit bbce58f

Please sign in to comment.