@techmely/utils
Version:
Collection of helpful JavaScript / TypeScript utils
21 lines (15 loc) • 424 B
JavaScript
/*!
* @techmely/utils
* Copyright(c) 2021-2024 Techmely <techmely.creation@gmail.com>
* MIT Licensed
*/
// src/isBrowser.ts
function isBrowser() {
return typeof window !== "undefined";
}
// src/alias.ts
var $ = (tag) => isBrowser() ? document.querySelector.call(void 0, tag) : null;
var $$ = (tag) => isBrowser() ? document.querySelectorAll.call(void 0, tag) : null;
exports.$ = $;
exports.$$ = $$;
;