mirror of
https://github.com/twbs/bootstrap.git
synced 2025-10-01 15:56:45 +02:00
fix: remove make array util function (#30430)
This commit is contained in:
@@ -127,14 +127,6 @@ const typeCheckConfig = (componentName, config, configTypes) => {
|
||||
})
|
||||
}
|
||||
|
||||
const makeArray = nodeList => {
|
||||
if (!nodeList) {
|
||||
return []
|
||||
}
|
||||
|
||||
return [].slice.call(nodeList)
|
||||
}
|
||||
|
||||
const isVisible = element => {
|
||||
if (!element) {
|
||||
return false
|
||||
@@ -200,7 +192,6 @@ export {
|
||||
isElement,
|
||||
emulateTransitionEnd,
|
||||
typeCheckConfig,
|
||||
makeArray,
|
||||
isVisible,
|
||||
findShadowRoot,
|
||||
noop,
|
||||
|
@@ -5,8 +5,6 @@
|
||||
* --------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
import { makeArray } from './index'
|
||||
|
||||
const uriAttrs = [
|
||||
'background',
|
||||
'cite',
|
||||
@@ -103,7 +101,7 @@ export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
||||
const domParser = new window.DOMParser()
|
||||
const createdDocument = domParser.parseFromString(unsafeHtml, 'text/html')
|
||||
const whitelistKeys = Object.keys(whiteList)
|
||||
const elements = makeArray(createdDocument.body.querySelectorAll('*'))
|
||||
const elements = [].concat(...createdDocument.body.querySelectorAll('*'))
|
||||
|
||||
for (let i = 0, len = elements.length; i < len; i++) {
|
||||
const el = elements[i]
|
||||
@@ -115,7 +113,7 @@ export function sanitizeHtml(unsafeHtml, whiteList, sanitizeFn) {
|
||||
continue
|
||||
}
|
||||
|
||||
const attributeList = makeArray(el.attributes)
|
||||
const attributeList = [].concat(...el.attributes)
|
||||
const whitelistedAttributes = [].concat(whiteList['*'] || [], whiteList[elName] || [])
|
||||
|
||||
attributeList.forEach(attr => {
|
||||
|
Reference in New Issue
Block a user