Switch to Set#has()
This commit is contained in:
parent
2e758f64cf
commit
6d7bc54d22
5 changed files with 15 additions and 16 deletions
|
|
@ -125,17 +125,17 @@ const getConfigByPluginKey = pluginKey => {
|
|||
}
|
||||
}
|
||||
|
||||
const utilObjects = [
|
||||
const utilObjects = new Set([
|
||||
'Util',
|
||||
'Sanitizer'
|
||||
]
|
||||
])
|
||||
|
||||
const domObjects = [
|
||||
const domObjects = new Set([
|
||||
'Data',
|
||||
'EventHandler',
|
||||
'Manipulator',
|
||||
'SelectorEngine'
|
||||
]
|
||||
])
|
||||
|
||||
const build = async plugin => {
|
||||
console.log(`Building ${plugin} plugin...`)
|
||||
|
|
@ -144,11 +144,11 @@ const build = async plugin => {
|
|||
const pluginFilename = path.basename(bsPlugins[plugin])
|
||||
let pluginPath = rootPath
|
||||
|
||||
if (utilObjects.includes(plugin)) {
|
||||
if (utilObjects.has(plugin)) {
|
||||
pluginPath = `${rootPath}/util/`
|
||||
}
|
||||
|
||||
if (domObjects.includes(plugin)) {
|
||||
if (domObjects.has(plugin)) {
|
||||
pluginPath = `${rootPath}/dom/`
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue