@alvarosabu_utils.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import "./chunk-JC4IRQUL.js";
  2. // node_modules/.pnpm/@alvarosabu+utils@2.3.0/node_modules/@alvarosabu/utils/dist/as-utils.js
  3. var l = typeof window < "u";
  4. var f = (n) => typeof n < "u";
  5. var p = (n) => n != null;
  6. var w = (n) => typeof n == "boolean";
  7. var g = (n) => typeof n == "function";
  8. var d = (n) => typeof n == "number";
  9. var C = (n) => typeof n == "string";
  10. var h = (n) => typeof window < "u" && toString.call(n) === "[object Window]";
  11. var r = (n) => !!n && n.constructor === Array;
  12. var s = (n) => !!n && n.constructor === Object;
  13. var S = (n) => !!n && n.constructor === Event;
  14. var _ = (n) => !!n && n.constructor.name === "Promise";
  15. var A = (n) => r(n) ? n.length <= 0 : s(n) ? Object.entries(n).length <= 0 : false;
  16. var E = (n) => n.toString().toLowerCase().replace(/\s+/g, "-").replace(/[^\w-]+/g, "").replace(/--+/g, "-").replace(/^-+/, "").replace(/-+$/, "");
  17. var c = (n) => {
  18. const t = {};
  19. return Object.keys(n).forEach((e) => {
  20. r(n[e]) ? t[e.replace(/(_\w)/g, (o) => o[1].toUpperCase())] = a(n[e]) : s(n[e]) ? t[e.replace(/(_\w)/g, (o) => o[1].toUpperCase())] = c(n[e]) : t[e.replace(/(_\w)/g, (o) => o[1].toUpperCase())] = n[e];
  21. }), t;
  22. };
  23. var i = (n) => {
  24. const t = {};
  25. return Object.keys(n).forEach((e) => {
  26. r(n[e]) ? t[e.replace(/([A-Z])/g, (o) => `_${o.toLowerCase()}`)] = n[e] = u(n[e]) : s(n[e]) ? t[e.replace(/([A-Z])/g, (o) => `_${o.toLowerCase()}`)] = n[e] = i(n[e]) : t[e.replace(/([A-Z])/g, (o) => `_${o.toLowerCase()}`)] = n[e];
  27. }), t;
  28. };
  29. var a = (n) => n.map((t) => r(t) ? a(t) : s(t) ? c(t) : t);
  30. var u = (n) => n.map((t) => r(t) ? u(t) : s(t) ? i(t) : t);
  31. function T(n, t, e) {
  32. return Math.min(e, Math.max(t, n));
  33. }
  34. function L(n) {
  35. return n != null;
  36. }
  37. function U(n) {
  38. return n !== null;
  39. }
  40. function $(n) {
  41. return n !== void 0;
  42. }
  43. function m(n) {
  44. return Boolean(n);
  45. }
  46. export {
  47. i as camelToSnake,
  48. T as clamp,
  49. p as hasValue,
  50. r as isArray,
  51. w as isBoolean,
  52. l as isBrowser,
  53. f as isDefined,
  54. A as isEmpty,
  55. S as isEvent,
  56. g as isFunction,
  57. d as isNumber,
  58. s as isObject,
  59. _ as isPromise,
  60. C as isString,
  61. m as isTruthy,
  62. h as isWindow,
  63. u as listCamelToSnake,
  64. a as listSnakeToCamel,
  65. U as noNull,
  66. L as notNullish,
  67. $ as notUndefined,
  68. E as slugify,
  69. c as snakeToCamel
  70. };
  71. //# sourceMappingURL=@alvarosabu_utils.js.map