mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-29 14:59:16 +02:00
Enable unicorn/no-for-loop
rule
This commit is contained in:
@@ -46,8 +46,8 @@ const allowedAttribute = (attribute, allowedAttributeList) => {
|
||||
const regExp = allowedAttributeList.filter(attributeRegex => attributeRegex instanceof RegExp)
|
||||
|
||||
// Check if a regular expression validates the attribute.
|
||||
for (let i = 0, len = regExp.length; i < len; i++) {
|
||||
if (regExp[i].test(attributeName)) {
|
||||
for (const element of regExp) {
|
||||
if (element.test(attributeName)) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
@@ -102,8 +102,7 @@ export function sanitizeHtml(unsafeHtml, allowList, sanitizeFn) {
|
||||
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')
|
||||
const elements = [].concat(...createdDocument.body.querySelectorAll('*'))
|
||||
|
||||
for (let i = 0, len = elements.length; i < len; i++) {
|
||||
const element = elements[i]
|
||||
for (const element of elements) {
|
||||
const elementName = element.nodeName.toLowerCase()
|
||||
|
||||
if (!Object.keys(allowList).includes(elementName)) {
|
||||
|
Reference in New Issue
Block a user