notes/sources/resources/js/utilities/helpers/index.js

39 lines
561 B
JavaScript
Raw Normal View History

2022-11-04 23:25:35 -06:00
import $$ from '@utilities/selectors'
/**
* @description Test if the body id is something
* @param {string}
* @return {bool}
*
*/
const page = function(name) {
if (!name) {
return $$.body.getAttribute('id')
}
return ($$.body.getAttribute('id') == name)
}
/**
* @description Check if element exists the page
* @param {string} Element selector
* @param {string} Minimum number of elements
* @return {bool}
*/
const exists = function(el, limit) {
return (el.length > 0)
}
export {
page,
exists
}