@vuetify/v0 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- import "../index-DY7-T630.mjs";
2
- import { a as isNull, c as isObject, d as isUndefined, f as mergeDeep, i as isFunction, l as isPrimitive, n as isArray, o as isNullOrUndefined, r as isBoolean, s as isNumber, t as genId, u as isString } from "../index-CSdGoUCI.mjs";
3
- export { genId, isArray, isBoolean, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isUndefined, mergeDeep };
1
+ import "../index-Bd3J4RNS.mjs";
2
+ import { _ as range, a as isBoolean, c as isNull, d as isObject, f as isPrimitive, g as mergeDeep, h as isUndefined, i as isArray, l as isNullOrUndefined, m as isSymbol, n as debounce, o as isFunction, p as isString, r as genId, s as isNaN, t as clamp, u as isNumber } from "../index-BXN7M6o_.mjs";
3
+ export { clamp, debounce, genId, isArray, isBoolean, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isSymbol, isUndefined, mergeDeep, range };
@@ -1,3 +1,3 @@
1
- import { a as isNull, c as isObject, d as isUndefined, f as mergeDeep, i as isFunction, l as isPrimitive, n as isArray, o as isNullOrUndefined, r as isBoolean, s as isNumber, t as genId, u as isString } from "../utilities-C26nB74O.mjs";
1
+ import { _ as range, a as isBoolean, c as isNull, d as isObject, f as isPrimitive, g as mergeDeep, h as isUndefined, i as isArray, l as isNullOrUndefined, m as isSymbol, n as debounce, o as isFunction, p as isString, r as genId, s as isNaN, t as clamp, u as isNumber } from "../utilities-DQWf_4V_.mjs";
2
2
 
3
- export { genId, isArray, isBoolean, isFunction, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isUndefined, mergeDeep };
3
+ export { clamp, debounce, genId, isArray, isBoolean, isFunction, isNaN, isNull, isNullOrUndefined, isNumber, isObject, isPrimitive, isString, isSymbol, isUndefined, mergeDeep, range };
@@ -0,0 +1,139 @@
1
+ //#region src/utilities/helpers.ts
2
+ /* @__NO_SIDE_EFFECTS__ */
3
+ function isFunction(item) {
4
+ return typeof item === "function";
5
+ }
6
+ /* @__NO_SIDE_EFFECTS__ */
7
+ function isString(item) {
8
+ return typeof item === "string";
9
+ }
10
+ /* @__NO_SIDE_EFFECTS__ */
11
+ function isNumber(item) {
12
+ return typeof item === "number";
13
+ }
14
+ /* @__NO_SIDE_EFFECTS__ */
15
+ function isBoolean(item) {
16
+ return typeof item === "boolean";
17
+ }
18
+ /* @__NO_SIDE_EFFECTS__ */
19
+ function isObject(item) {
20
+ return typeof item === "object" && item !== null && !Array.isArray(item);
21
+ }
22
+ /* @__NO_SIDE_EFFECTS__ */
23
+ function isArray(item) {
24
+ return Array.isArray(item);
25
+ }
26
+ /* @__NO_SIDE_EFFECTS__ */
27
+ function isNull(item) {
28
+ return item === null;
29
+ }
30
+ /* @__NO_SIDE_EFFECTS__ */
31
+ function isNullOrUndefined(item) {
32
+ return item == null;
33
+ }
34
+ /* @__NO_SIDE_EFFECTS__ */
35
+ function isUndefined(item) {
36
+ return item === void 0;
37
+ }
38
+ /* @__NO_SIDE_EFFECTS__ */
39
+ function isPrimitive(item) {
40
+ return typeof item === "string" || typeof item === "number" || typeof item === "boolean";
41
+ }
42
+ /* @__NO_SIDE_EFFECTS__ */
43
+ function isSymbol(item) {
44
+ return typeof item === "symbol";
45
+ }
46
+ /* @__NO_SIDE_EFFECTS__ */
47
+ function isNaN(item) {
48
+ return /* @__PURE__ */ isNumber(item) && Number.isNaN(item);
49
+ }
50
+ /* @__NO_SIDE_EFFECTS__ */
51
+ function mergeDeep(target, ...sources) {
52
+ if (sources.length === 0) return target;
53
+ const source = sources.shift();
54
+ if (/* @__PURE__ */ isObject(target) && /* @__PURE__ */ isObject(source)) {
55
+ for (const key in source) if (Object.prototype.hasOwnProperty.call(source, key)) {
56
+ const sourceValue = source[key];
57
+ const targetValue = target[key];
58
+ if (/* @__PURE__ */ isObject(sourceValue)) {
59
+ if (!/* @__PURE__ */ isObject(targetValue)) Object.assign(target, { [key]: {} });
60
+ } else Object.assign(target, { [key]: sourceValue });
61
+ }
62
+ }
63
+ return /* @__PURE__ */ mergeDeep(target, ...sources);
64
+ }
65
+ /* @__NO_SIDE_EFFECTS__ */
66
+ function genId() {
67
+ return Math.random().toString(36).slice(2, 9);
68
+ }
69
+ /**
70
+ * Clamps a value between a minimum and maximum
71
+ *
72
+ * @param value The value to clamp
73
+ * @param min The minimum value (default: 0)
74
+ * @param max The maximum value (default: 1)
75
+ * @returns The clamped value
76
+ *
77
+ * @example
78
+ * ```ts
79
+ * clamp(5, 0, 10) // 5
80
+ * clamp(-5, 0, 10) // 0
81
+ * clamp(15, 0, 10) // 10
82
+ * ```
83
+ */
84
+ /* @__NO_SIDE_EFFECTS__ */
85
+ function clamp(value, min = 0, max = 1) {
86
+ return Math.max(min, Math.min(max, value));
87
+ }
88
+ /**
89
+ * Creates an array of sequential numbers
90
+ *
91
+ * @param length The length of the array to create
92
+ * @param start The starting index (default: 0)
93
+ * @returns An array of sequential numbers
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * range(3) // [0, 1, 2]
98
+ * range(3, 1) // [1, 2, 3]
99
+ * range(5, 10) // [10, 11, 12, 13, 14]
100
+ * range(0) // []
101
+ * ```
102
+ */
103
+ /* @__NO_SIDE_EFFECTS__ */
104
+ function range(length, start = 0) {
105
+ return Array.from({ length }, (_, index) => start + index);
106
+ }
107
+ /**
108
+ * Debounces a function call by the specified delay
109
+ *
110
+ * @param fn The function to debounce
111
+ * @param delay The delay in milliseconds
112
+ * @returns A debounced function with clear and immediate methods
113
+ *
114
+ * @example
115
+ * ```ts
116
+ * const debouncedFn = debounce(() => console.log('called'), 500)
117
+ * debouncedFn() // Will call after 500ms
118
+ * debouncedFn.clear() // Cancel pending call
119
+ * debouncedFn.immediate() // Call immediately
120
+ * ```
121
+ */
122
+ function debounce(fn, delay) {
123
+ let timeoutId;
124
+ function debounced(...args) {
125
+ if (!/* @__PURE__ */ isUndefined(timeoutId)) clearTimeout(timeoutId);
126
+ timeoutId = setTimeout(() => fn(...args), delay);
127
+ }
128
+ debounced.clear = () => {
129
+ if (!/* @__PURE__ */ isUndefined(timeoutId)) clearTimeout(timeoutId);
130
+ };
131
+ debounced.immediate = (...args) => {
132
+ debounced.clear();
133
+ fn(...args);
134
+ };
135
+ return debounced;
136
+ }
137
+
138
+ //#endregion
139
+ export { range as _, isBoolean as a, isNull as c, isObject as d, isPrimitive as f, mergeDeep as g, isUndefined as h, isArray as i, isNullOrUndefined as l, isSymbol as m, debounce as n, isFunction as o, isString as p, genId as r, isNaN as s, clamp as t, isNumber as u };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuetify/v0",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "Vuetify0",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.mjs",