智慧水务管理系统 - 精河县供水工程综合管理平台

element.mjs 402B

12345678910111213141516
  1. import { isClient } from "../browser.mjs";
  2. import { isString } from "../types.mjs";
  3. //#region ../../packages/utils/dom/element.ts
  4. const getElement = ((target) => {
  5. if (!isClient || target === "") return null;
  6. if (isString(target)) try {
  7. return document.querySelector(target);
  8. } catch {
  9. return null;
  10. }
  11. return target;
  12. });
  13. //#endregion
  14. export { getElement };
  15. //# sourceMappingURL=element.mjs.map