1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-02 18:02:37 +02:00

fix: remove make array util function (#30430)

This commit is contained in:
Johann-S
2020-03-25 15:35:02 +01:00
committed by GitHub
parent 98c4598696
commit 26d86fce2a
17 changed files with 53 additions and 89 deletions

View File

@@ -6,7 +6,6 @@
*/
import { find as findFn, findOne } from './polyfill'
import { makeArray } from '../util/index'
/**
* ------------------------------------------------------------------------
@@ -22,7 +21,7 @@ const SelectorEngine = {
},
find(selector, element = document.documentElement) {
return findFn.call(element, selector)
return [].concat(...findFn.call(element, selector))
},
findOne(selector, element = document.documentElement) {
@@ -30,9 +29,9 @@ const SelectorEngine = {
},
children(element, selector) {
const children = makeArray(element.children)
const children = [].concat(...element.children)
return children.filter(child => this.matches(child, selector))
return children.filter(child => child.matches(selector))
},
parents(element, selector) {
@@ -59,7 +58,7 @@ const SelectorEngine = {
let previous = element.previousElementSibling
while (previous) {
if (this.matches(previous, selector)) {
if (previous.matches(selector)) {
return [previous]
}