8a43a10d by Adam Heath

Fix typo(s) on caseSensitive.

1 parent 3a2d50c1
...@@ -96,9 +96,9 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => { ...@@ -96,9 +96,9 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => {
96 } 96 }
97 } 97 }
98 98
99 const getAttrValueMatch = (value: string, operator: string = '=', caseSenstive: boolean): AttrValueMatch => { 99 const getAttrValueMatch = (value: string, operator: string = '=', caseSensitive: boolean): AttrValueMatch => {
100 if (value === undefined) return (attrValue) => attrValue !== undefined 100 if (value === undefined) return (attrValue) => attrValue !== undefined
101 const isCaseInsenstive = caseSensitive === 'i' 101 const isCaseInsensitive = caseSensitive === 'i'
102 if (isCaseInsensitive) value = value.toLowerCase() 102 if (isCaseInsensitive) value = value.toLowerCase()
103 const adjustMatcher = (matcher) => isCaseInsensitive ? (attrValue) => matcher(attrValue.toLowerCase()) : matcher 103 const adjustMatcher = (matcher) => isCaseInsensitive ? (attrValue) => matcher(attrValue.toLowerCase()) : matcher
104 switch (operator) { 104 switch (operator) {
...@@ -272,7 +272,7 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => { ...@@ -272,7 +272,7 @@ const compileMatcher = (ast: AST, selector: string): MatcherProducer => {
272 } 272 }
273 case 'attribute': 273 case 'attribute':
274 const { caseSensitive, name, value, operator } = ast 274 const { caseSensitive, name, value, operator } = ast
275 const attrValueMatch = getAttrValueMatch(value, operator, caseSenstive) 275 const attrValueMatch = getAttrValueMatch(value, operator, caseSensitive)
276 return (context, node, parent, i, debug) => { 276 return (context, node, parent, i, debug) => {
277 const { attributes: { [ name ]: attrValue } = {} } = node 277 const { attributes: { [ name ]: attrValue } = {} } = node
278 return attrValueMatch(attrValue) 278 return attrValueMatch(attrValue)
......