8a43a10d by Adam Heath

Fix typo(s) on caseSensitive.

1 parent 3a2d50c1
......@@ -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 = '=', caseSensitive: boolean): AttrValueMatch => {
if (value === undefined) return (attrValue) => attrValue !== undefined
const isCaseInsenstive = caseSensitive === 'i'
const isCaseInsensitive = 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, caseSensitive)
return (context, node, parent, i, debug) => {
const { attributes: { [ name ]: attrValue } = {} } = node
return attrValueMatch(attrValue)
......