Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
brainfood
/
astro-wt
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
8a43a10d
authored
2024-06-26 14:27:18 -0500
by
Adam Heath
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
Fix typo(s) on caseSensitive.
1 parent
3a2d50c1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
lib/html.ts
lib/html.ts
View file @
8a43a10
...
...
@@ -96,9 +96,9 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => {
}
}
const
getAttrValueMatch
=
(
value
:
string
,
operator
:
string
=
'='
,
caseSenstive
:
boolean
):
AttrValueMatch
=>
{
const
getAttrValueMatch
=
(
value
:
string
,
operator
:
string
=
'='
,
caseSens
i
tive
:
boolean
):
AttrValueMatch
=>
{
if
(
value
===
undefined
)
return
(
attrValue
)
=>
attrValue
!==
undefined
const
isCaseInsenstive
=
caseSensitive
===
'i'
const
isCaseInsens
i
tive
=
caseSensitive
===
'i'
if
(
isCaseInsensitive
)
value
=
value
.
toLowerCase
()
const
adjustMatcher
=
(
matcher
)
=>
isCaseInsensitive
?
(
attrValue
)
=>
matcher
(
attrValue
.
toLowerCase
())
:
matcher
switch
(
operator
)
{
...
...
@@ -272,7 +272,7 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => {
}
case
'attribute'
:
const
{
caseSensitive
,
name
,
value
,
operator
}
=
ast
const
attrValueMatch
=
getAttrValueMatch
(
value
,
operator
,
caseSenstive
)
const
attrValueMatch
=
getAttrValueMatch
(
value
,
operator
,
caseSens
i
tive
)
return
(
context
,
node
,
parent
,
i
,
debug
)
=>
{
const
{
attributes
:
{
[
name
]:
attrValue
}
=
{}
}
=
node
return
attrValueMatch
(
attrValue
)
...
...
Please
register
or
sign in
to post a comment