clsx-umd

A UMD build of clsx

此腳本不應該直接安裝,它是一個供其他腳本使用的函式庫。欲使用本函式庫,請在腳本 metadata 寫上: // @require https://update.gf.qytechs.cn/scripts/510659/1456034/clsx-umd.js

  1. (function (global, factory) {
  2. typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  3. typeof define === 'function' && define.amd ? define(factory) :
  4. (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.clsx = factory());
  5. })(this, (() => {
  6. function r(e) {
  7. var t, f, n = "";
  8. if ("string" == typeof e || "number" == typeof e)
  9. n += e;
  10. else if ("object" == typeof e)
  11. if (Array.isArray(e)) {
  12. var o = e.length;
  13. for (t = 0; t < o; t++)
  14. e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
  15. } else
  16. for (f in e)
  17. e[f] && (n && (n += " "), n += f);
  18. return n;
  19. }
  20. function clsx() {
  21. for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++)
  22. (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
  23. return n;
  24. }
  25. return clsx;
  26. }));

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址