@zuzjs/core 0.3.0 → 0.3.2

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,26 +0,0 @@
1
- /**
2
- * An array of color names.
3
- *
4
- * @remarks
5
- * This array contains a list of color names that can be used in CSS or other color-related operations.
6
- */
7
- export const colorNames = [
8
- 'aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'lightsalmon', 'lightseagreen', 'lightskyblue', 'lightslategray', 'lightslategrey', 'lightsteelblue', 'lightyellow', 'lime', 'limegreen', 'linen', 'magenta', 'maroon', 'mediumaquamarine', 'mediumblue', 'mediumorchid', 'mediumpurple', 'mediumseagreen', 'mediumslateblue', 'mediumspringgreen', 'mediumturquoise', 'mediumvioletred', 'midnightblue', 'mintcream', 'mistyrose', 'moccasin', 'navajowhite', 'navy', 'oldlace', 'olive', 'olivedrab', 'orange', 'orangered', 'orchid', 'palegoldenrod', 'palegreen', 'paleturquoise', 'palevioletred', 'papayawhip', 'peachpuff', 'peru', 'pink', 'plum', 'powderblue', 'purple', 'rebeccapurple', 'red', 'rosybrown', 'royalblue', 'saddlebrown', 'salmon', 'sandybrown', 'seagreen', 'seashell', 'sienna', 'silver', 'skyblue', 'slateblue', 'slategray', 'slategrey', 'snow', 'springgreen', 'steelblue', 'tan', 'teal', 'thistle', 'tomato', 'turquoise', 'violet', 'wheat', 'white', 'whitesmoke', 'yellow', 'yellowgreen'
9
- ];
10
- /**
11
- * colorPalatter contains colors and their corresponding shades.
12
- */
13
- export const colorPalette = {
14
- green: {
15
- 50: '#e8f5e9',
16
- 100: '#c8e6c9',
17
- 200: '#a5d6a7',
18
- 300: '#81c784',
19
- 400: '#66bb6a',
20
- 500: '#4caf50',
21
- 600: '#43a047',
22
- 700: '#388e3c',
23
- 800: '#2e7d32',
24
- 900: '#1b5e20',
25
- },
26
- };
@@ -1,51 +0,0 @@
1
- import { AxiosProgressEvent, AxiosRequestConfig, CancelTokenSource } from "axios";
2
- import { RefObject } from "react";
3
- import { FormatNumberParams, sortOptions } from "./types.js";
4
- export { CancelTokenSource, AxiosProgressEvent as UploadProgressEvent };
5
- export * from "./types.js";
6
- export declare const __SALT: string;
7
- export { default as "_" } from "./withGlobals.js";
8
- export declare const numberInRange: (min: number, max: number) => number;
9
- export declare const toHash: (n: number, len?: number, SALT?: string | null) => string;
10
- export declare const fromHash: (str: string, SALT?: string | null) => number;
11
- export declare const MD5: (str: string) => string;
12
- export declare const uuid: (len: number) => string;
13
- export declare const ucfirst: (o: any) => string;
14
- export declare const urldecode: (str: string) => string;
15
- export declare const urlencode: (str: string) => string;
16
- export declare const pluralize: (word: string, count: number) => string;
17
- export declare const isHexColor: (color: string) => boolean;
18
- export declare const isRgbaColor: (color: string) => boolean;
19
- export declare const isHslColor: (color: string) => boolean;
20
- export declare const isColorName: (color: string) => boolean;
21
- export declare const isColor: (color: string) => boolean;
22
- export declare const hexToRgba: (hex: string, alpha?: number) => string;
23
- export declare const removeDuplicates: <T>(array: T[]) => T[];
24
- export declare const getCancelToken: () => CancelTokenSource;
25
- export declare const withCredentials: (include: boolean) => boolean;
26
- export declare const withPost: <T>(uri: string, data: any, // 'dynamic' usually maps to 'any' or 'Record<string, any>'
27
- timeout?: number, ignoreKind?: boolean, headers?: AxiosRequestConfig["headers"], onProgress?: (ev: AxiosProgressEvent) => void) => Promise<T>;
28
- export declare const withGet: <T>(uri: string, timeout?: number, ignoreKind?: boolean, headers?: AxiosRequestConfig["headers"]) => Promise<T>;
29
- export declare const withTime: (fun: (...args: any[]) => any) => {
30
- result: any;
31
- executionTime: number;
32
- };
33
- export declare const time: (stamp?: number, format?: string) => string;
34
- export declare const timeSince: (stamp: number) => string;
35
- export declare const arrayRand: (arr: any[]) => any;
36
- export declare const formatNumber: ({ number, locale, style, decimal, forceDecimal, currency }: FormatNumberParams) => string;
37
- export declare const formatSize: (bytes: number | string) => string;
38
- export declare const copyToClipboard: (text: string) => Promise<unknown>;
39
- export declare const natsort: (options?: sortOptions) => (a: string | number, b: string | number) => number;
40
- export declare const camelCase: (str: string, ucf?: boolean) => string;
41
- export declare const camelCaseToDash: (str: string) => string;
42
- export declare const clamp: (value: number, min: number, max: number) => number;
43
- export declare const slugify: (text: string, separator?: string) => string;
44
- export declare const animateCSSVar: (ref: RefObject<HTMLElement>, variable: string, to: number, { lerpFactor, threshold, multiplier, }?: {
45
- lerpFactor?: number;
46
- threshold?: number;
47
- multiplier?: number;
48
- }) => void;
49
- export declare const sleep: (ms: number) => Promise<any>;
50
- export declare const enumToKeys: <T extends Record<string, any>>(obj: T) => Array<keyof T>;
51
- export declare const exists: (path: string) => Promise<boolean>;
package/dist/esm/index.js DELETED
@@ -1,380 +0,0 @@
1
- import axios from "axios";
2
- import fs from "fs/promises";
3
- import Hashids from "hashids";
4
- import Cookies from "js-cookie";
5
- import md5 from "md5";
6
- import moment from "moment";
7
- import { colorNames } from "./colors.js";
8
- import { hexColorRegex, hslColorRegex, rgbaColorRegex } from "./regexps.js";
9
- import { SORT } from "./types.js";
10
- import _ from "./withGlobals.js";
11
- export * from "./types.js";
12
- export const __SALT = `zuzjs-core`;
13
- export { default as "_" } from "./withGlobals.js";
14
- export const numberInRange = (min, max) => {
15
- return Math.floor(Math.random() * (max - min + 1)) + min;
16
- };
17
- export const toHash = (n, len = 6, SALT = null) => new Hashids(SALT || __SALT, len).encode(n);
18
- export const fromHash = (str, SALT = null) => {
19
- try {
20
- const n = new Hashids(SALT || __SALT, +process.env.HASHIDS_LENGTH).decode(str);
21
- return n.length >= 0 ? Number(n[0]) : 0;
22
- }
23
- catch (e) {
24
- return 0;
25
- }
26
- };
27
- export const MD5 = (str) => md5(str);
28
- export const uuid = (len) => toHash(numberInRange(11111111111, 999999999999));
29
- export const ucfirst = (o) => `${o.charAt(0).toUpperCase()}${o.substring(1, o.length)}`;
30
- export const urldecode = (str) => decodeURIComponent(str.replace(/\+/g, '%20'));
31
- export const urlencode = (str) => encodeURIComponent(str);
32
- export const pluralize = (word, count) => `${word}${count !== 1 ? 's' : ''}`;
33
- export const isHexColor = (color) => hexColorRegex.test(color);
34
- export const isRgbaColor = (color) => rgbaColorRegex.test(color);
35
- export const isHslColor = (color) => hslColorRegex.test(color);
36
- export const isColorName = (color) => colorNames.includes(color.toLowerCase());
37
- // Function to validate a color string
38
- export const isColor = (color) => isHexColor(color) || isRgbaColor(color) || isHslColor(color);
39
- export const hexToRgba = (hex, alpha = 1) => {
40
- // Remove the hash symbol if present
41
- hex = hex.replace(/^#/, '');
42
- // If shorthand hex (#RGB), expand it to full form (#RRGGBB)
43
- if (hex.length === 3) {
44
- hex = hex.split('').map(char => char + char).join('');
45
- }
46
- // Convert to integer values for RGB
47
- const bigint = parseInt(hex, 16);
48
- const r = (bigint >> 16) & 255;
49
- const g = (bigint >> 8) & 255;
50
- const b = bigint & 255;
51
- return `rgba(${r}, ${g}, ${b}, ${alpha})`;
52
- };
53
- export const removeDuplicates = (array) => {
54
- return array.reduce((accumulator, currentValue) => {
55
- if (!accumulator.includes(currentValue)) {
56
- accumulator.push(currentValue);
57
- }
58
- return accumulator;
59
- }, []);
60
- };
61
- export const getCancelToken = () => axios.CancelToken.source();
62
- export const withCredentials = (include) => axios.defaults.withCredentials = include;
63
- export const withPost = async (uri, data, // 'dynamic' usually maps to 'any' or 'Record<string, any>'
64
- timeout = 60, ignoreKind = false, headers = {}, onProgress) => {
65
- const _cookies = Cookies.get();
66
- let finalData = data;
67
- let contentType = 'application/json';
68
- // 1. Data Preparation Logic
69
- if (data instanceof FormData) {
70
- contentType = 'multipart/form-data';
71
- for (const [key, value] of Object.entries(_cookies)) {
72
- data.append(key, value);
73
- }
74
- }
75
- else if (typeof data === "object" && !Array.isArray(data) && data !== null) {
76
- // Handle standard objects: inject cookies and timestamp
77
- finalData = {
78
- ...data,
79
- ..._cookies,
80
- __stmp: Date.now() / 1000
81
- };
82
- }
83
- else if (!_(data).isString()) {
84
- // If it's not FormData, an Object, or a String, reject immediately
85
- throw new Error("Unsupported data type for withPost");
86
- }
87
- // 2. Single Axios Execution
88
- try {
89
- const resp = await axios({
90
- method: 'post',
91
- url: uri,
92
- data: finalData,
93
- timeout: timeout * 1000,
94
- headers: {
95
- 'Content-Type': contentType,
96
- ...headers
97
- },
98
- onUploadProgress: onProgress
99
- });
100
- // 3. Response Validation
101
- if (resp.data && (ignoreKind || "kind" in resp.data)) {
102
- return resp.data;
103
- }
104
- else {
105
- throw resp.data;
106
- }
107
- }
108
- catch (err) {
109
- // 4. Centralized Error Handling
110
- if (err?.response?.data) {
111
- throw err.response.data;
112
- }
113
- throw err.code === `ERR_NETWORK`
114
- ? {
115
- error: err.code,
116
- message: navigator.onLine
117
- ? `Unable to connect to the server. It may be temporarily down.`
118
- : `Network error: Unable to connect. Please check your internet connection and try again.`,
119
- }
120
- : err;
121
- }
122
- };
123
- export const withGet = async (uri, timeout = 60, ignoreKind = false, headers = {}) => {
124
- try {
125
- const resp = await axios.get(uri, {
126
- timeout: timeout * 1000,
127
- headers: headers
128
- });
129
- if (resp.data && (ignoreKind || "kind" in resp.data)) {
130
- return resp.data;
131
- }
132
- else {
133
- throw resp.data;
134
- }
135
- }
136
- catch (err) {
137
- if (err?.response?.data) {
138
- throw err.response.data;
139
- }
140
- throw err.code === `ERR_NETWORK`
141
- ? {
142
- error: err.code,
143
- message: navigator.onLine
144
- ? `Unable to connect to the server. It may be temporarily down.`
145
- : `Network error: Unable to connect. Please check your internet connection and try again.`,
146
- }
147
- : err;
148
- }
149
- };
150
- export const withTime = (fun) => {
151
- const start = new Date().getTime();
152
- const result = fun();
153
- const end = new Date().getTime();
154
- return {
155
- result,
156
- executionTime: end - start
157
- };
158
- };
159
- export const time = (stamp, format) => {
160
- return stamp ?
161
- moment.unix(+stamp / 1000).format(format || `YYYY-MM-DD HH:mm:ss`)
162
- : moment().format(format || `YYYY-MM-DD HH:mm:ss`);
163
- };
164
- export const timeSince = (stamp) => moment(stamp).fromNow();
165
- export const arrayRand = (arr) => arr[Math.floor(Math.random() * arr.length)];
166
- export const formatNumber = ({ number, locale = 'en-US', style = `decimal`, decimal = 2, forceDecimal = false, currency }) => {
167
- if (style === 'currency' && !currency) {
168
- throw new TypeError('Currency code is required with currency style.');
169
- }
170
- if (currency) {
171
- const { code, style: currencyStyle, symbol } = currency;
172
- const out = new Intl.NumberFormat(locale, {
173
- style: `currency`,
174
- currency: code,
175
- currencyDisplay: currencyStyle,
176
- minimumFractionDigits: forceDecimal ? decimal : +number % 1 > 0 ? decimal : 0,
177
- maximumFractionDigits: forceDecimal ? decimal : +number % 1 > 0 ? decimal : 0
178
- }).format(+number);
179
- return symbol ? out.replace(new RegExp(`\\${code}`, 'g'), symbol) : out;
180
- }
181
- return new Intl.NumberFormat(locale, {
182
- style,
183
- minimumFractionDigits: forceDecimal ? decimal : +number % 1 > 0 ? 2 : 0,
184
- maximumFractionDigits: forceDecimal ? decimal : +number % 1 > 0 ? 2 : 0
185
- }).format(+number);
186
- };
187
- export const formatSize = (bytes) => {
188
- const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
189
- const _bytes = `string` == typeof bytes ? parseFloat(bytes) : bytes;
190
- if (_bytes == 0)
191
- return '0 Byte';
192
- const _i = Math.floor(Math.log(_bytes) / Math.log(1024));
193
- const i = `string` == typeof _i ? parseInt(_i) : _i;
194
- const nx = _bytes / Math.pow(1024, i);
195
- return nx.toFixed(2) + ' ' + sizes[i];
196
- };
197
- export const copyToClipboard = (text) => {
198
- if (navigator.clipboard && navigator.clipboard.writeText) {
199
- return navigator.clipboard.writeText(text);
200
- }
201
- else {
202
- return new Promise((resolve, reject) => {
203
- const textarea = document.createElement("textarea");
204
- textarea.value = text;
205
- textarea.style.position = "fixed"; // Prevent scrolling to bottom of page in MS Edge.
206
- document.body.appendChild(textarea);
207
- textarea.focus();
208
- textarea.select();
209
- try {
210
- document.execCommand("copy");
211
- resolve(`Copied to clipboard`);
212
- }
213
- catch (err) {
214
- // console.error("Fallback: Oops, unable to copy", err);
215
- reject(err);
216
- }
217
- document.body.removeChild(textarea);
218
- });
219
- }
220
- };
221
- export const natsort = (options = {
222
- direction: SORT.Asc,
223
- caseSensitive: false,
224
- }) => {
225
- const ore = /^0/;
226
- const sre = /\s+/g;
227
- const tre = /^\s+|\s+$/g;
228
- // unicode
229
- const ure = /[^\x00-\x80]/;
230
- // hex
231
- const hre = /^0x[0-9a-f]+$/i;
232
- // numeric
233
- const nre = /(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g;
234
- // datetime
235
- const dre = /(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/; // tslint:disable-line
236
- const GREATER = options.direction == SORT.Desc ? -1 : 1;
237
- const SMALLER = -GREATER;
238
- const _normalize = !options.caseSensitive
239
- ? (s) => s.toString().toLowerCase().replace(tre, '')
240
- : (s) => (`${s}`).replace(tre, '');
241
- const _tokenize = (s) => {
242
- return s.replace(nre, '\0$1\0')
243
- .replace(/\0$/, '')
244
- .replace(/^\0/, '')
245
- .split('\0');
246
- };
247
- const _parse = (s, l) => {
248
- return (!s.match(ore) || l === 1) &&
249
- parseFloat(s)
250
- || s.replace(sre, ' ').replace(tre, '')
251
- || 0;
252
- };
253
- return function (a, b) {
254
- const aa = _normalize(a);
255
- const bb = _normalize(b);
256
- if (!aa && !bb) {
257
- return 0;
258
- }
259
- if (!aa && bb) {
260
- return SMALLER;
261
- }
262
- if (aa && !bb) {
263
- return GREATER;
264
- }
265
- const aArr = _tokenize(aa);
266
- const bArr = _tokenize(bb);
267
- // hex or date detection
268
- const aHex = aa.match(hre);
269
- const bHex = bb.match(hre);
270
- const av = (aHex && bHex) ? parseInt(aHex[0], 16) : (aArr.length !== 1 && Date.parse(aa));
271
- const bv = (aHex && bHex)
272
- ? parseInt(bHex[0], 16)
273
- : av && bb.match(dre) && Date.parse(bb) || null;
274
- // try and sort Hex codes or Dates
275
- if (bv) {
276
- if (av === bv) {
277
- return 0;
278
- }
279
- if (typeof av === 'number' && typeof bv === 'number' && av < bv) {
280
- return SMALLER;
281
- }
282
- if (typeof av === 'number' && av > bv) {
283
- return GREATER;
284
- }
285
- }
286
- const al = aArr.length;
287
- const bl = bArr.length;
288
- // handle numeric strings and default strings
289
- for (let i = 0, l = Math.max(al, bl); i < l; i += 1) {
290
- const af = _parse(aArr[i] || '', al);
291
- const bf = _parse(bArr[i] || '', bl);
292
- if (isNaN(af) !== isNaN(bf)) {
293
- return isNaN(af) ? GREATER : SMALLER;
294
- }
295
- if (ure.test(af + bf) && af.localeCompare) {
296
- const comp = af.localeCompare(bf);
297
- if (comp > 0) {
298
- return GREATER;
299
- }
300
- if (comp < 0) {
301
- return SMALLER;
302
- }
303
- if (i === l - 1) {
304
- return 0;
305
- }
306
- }
307
- if (af < bf) {
308
- return SMALLER;
309
- }
310
- if (af > bf) {
311
- return GREATER;
312
- }
313
- if (`${af}` < `${bf}`) {
314
- return SMALLER;
315
- }
316
- if (`${af}` > `${bf}`) {
317
- return GREATER;
318
- }
319
- }
320
- return 0;
321
- };
322
- };
323
- export const camelCase = (str, ucf = false) => {
324
- return str
325
- .toLowerCase()
326
- .split(/[^a-zA-Z0-9]+/) // Split by any non-alphanumeric character
327
- .map((word, index) => index === 0
328
- ? ucf ? ucfirst(word) : word
329
- : ucfirst(word))
330
- .join('');
331
- };
332
- export const camelCaseToDash = (str) => str.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
333
- export const clamp = (value, min, max) => {
334
- return Math.min(Math.max(value, min), max);
335
- };
336
- export const slugify = (text, separator = "-") => {
337
- if (undefined == text) {
338
- console.log(text, `is undefined`);
339
- return ``;
340
- }
341
- return text
342
- .normalize("NFKD") // Normalize accents (e.g., é → e)
343
- .replace(/[\u0300-\u036f]/g, "") // Remove diacritic marks
344
- .toLowerCase()
345
- .replace(/[^a-z0-9\p{L}\p{N}]+/gu, separator) // Keep letters/numbers from all languages
346
- .replace(new RegExp(`\\${separator}{2,}`, "g"), separator) // Remove duplicate separators
347
- .replace(new RegExp(`^\\${separator}|\\${separator}$`, "g"), ""); // Trim separators from ends
348
- };
349
- export const animateCSSVar = (ref, variable, to, { lerpFactor = 0.1, threshold = 0.1, multiplier = 1, } = {}) => {
350
- if (!ref.current)
351
- return;
352
- let current = parseFloat(getComputedStyle(ref.current).getPropertyValue(variable)) || 0;
353
- let target = to * multiplier;
354
- let rafId = null;
355
- const tick = () => {
356
- current += (target - current) * lerpFactor;
357
- if (ref.current) {
358
- ref.current.style.setProperty(variable, `${current}px`);
359
- }
360
- if (Math.abs(target - current) > threshold) {
361
- rafId = requestAnimationFrame(tick);
362
- }
363
- };
364
- // Cancel if a new target arrives
365
- if (rafId)
366
- cancelAnimationFrame(rafId);
367
- requestAnimationFrame(tick);
368
- };
369
- export const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
370
- export const enumToKeys = (obj) => Object.keys(obj)
371
- .filter((key) => isNaN(Number(key)));
372
- export const exists = async (path) => {
373
- try {
374
- await fs.access(path);
375
- return true;
376
- }
377
- catch {
378
- return false;
379
- }
380
- };
@@ -1,3 +0,0 @@
1
- export declare const hexColorRegex: RegExp;
2
- export declare const rgbaColorRegex: RegExp;
3
- export declare const hslColorRegex: RegExp;
@@ -1,6 +0,0 @@
1
- // Hex color regex (#RGB, #RRGGBB)
2
- export const hexColorRegex = /^#([A-Fa-f0-9]{3}){1,2}$/;
3
- // RGBA color regex (rgba(255, 255, 255, 1))
4
- export const rgbaColorRegex = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*((0|1|0?\.\d+)\s*))?\)$/;
5
- // HSL color regex (hsl(360, 100%, 100%))
6
- export const hslColorRegex = /^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/;
@@ -1,23 +0,0 @@
1
- export type dynamic = {
2
- [x: string]: any;
3
- };
4
- export interface FormatNumberParams {
5
- number: number | string;
6
- locale?: string;
7
- style?: `decimal` | `currency` | `percent`;
8
- decimal?: number;
9
- forceDecimal?: boolean;
10
- currency?: {
11
- code: string;
12
- style: `symbol` | `code` | `name`;
13
- symbol?: string;
14
- };
15
- }
16
- export declare enum SORT {
17
- Asc = "ASC",
18
- Desc = "DESC"
19
- }
20
- export type sortOptions = {
21
- direction?: SORT;
22
- caseSensitive?: boolean;
23
- };
package/dist/esm/types.js DELETED
@@ -1,5 +0,0 @@
1
- export var SORT;
2
- (function (SORT) {
3
- SORT["Asc"] = "ASC";
4
- SORT["Desc"] = "DESC";
5
- })(SORT || (SORT = {}));
@@ -1,41 +0,0 @@
1
- declare class withGlobals {
2
- _: any;
3
- constructor(value: any);
4
- isIP(): boolean;
5
- isIPv4(): boolean;
6
- isIPv6(): boolean;
7
- isTypeof(v: any): boolean;
8
- isFunction(): boolean;
9
- isArray(): boolean;
10
- isNull(): boolean;
11
- isString(): boolean;
12
- isNumber(): boolean;
13
- isObject(): boolean;
14
- isEmpty(): boolean;
15
- isEmail(): boolean;
16
- isUrl(): boolean;
17
- toLowerCase(): this;
18
- /**
19
- * Performs a deep equality check for arrays and objects, otherwise a strict equality check.
20
- * @param v The value to compare against.
21
- * @returns {boolean} True if the values are equal, false otherwise.
22
- */
23
- equals(v: any): boolean;
24
- private isObjectValue;
25
- ucfirst(): this;
26
- formatString(v: string | number, ...vv: (string | number)[]): this;
27
- camelCase(): this;
28
- /**
29
- * Sorts the keys of the internal object in ascending or descending order.
30
- * If the internal value is not an object, it remains unchanged.
31
- * @param order The sort order: 'asc' for ascending (default), 'desc' for descending.
32
- * @returns {this} The current instance for chaining.
33
- */
34
- sort(order?: 'asc' | 'desc'): this;
35
- value(): any;
36
- valueOf(): any;
37
- toString(): string;
38
- [Symbol.toPrimitive](hint: string): string | number | boolean;
39
- }
40
- declare const _: <T>(value: T) => withGlobals;
41
- export default _;