@zairakai/js-utils 1.0.0
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.
- package/LICENSE +21 -0
- package/README.md +270 -0
- package/dist/arrays.cjs +210 -0
- package/dist/arrays.d.cts +119 -0
- package/dist/arrays.d.ts +119 -0
- package/dist/arrays.js +32 -0
- package/dist/chunk-27YHP2CK.js +407 -0
- package/dist/chunk-3WNRYKPG.js +37 -0
- package/dist/chunk-42CHLXT7.js +214 -0
- package/dist/chunk-6F4PWJZI.js +0 -0
- package/dist/chunk-7SXRFZBB.js +173 -0
- package/dist/chunk-F6RSTW65.js +156 -0
- package/dist/chunk-G7ZJ23DW.js +253 -0
- package/dist/chunk-IPP7PA6H.js +136 -0
- package/dist/chunk-LDSWHSRX.js +96 -0
- package/dist/chunk-TY75OOIQ.js +700 -0
- package/dist/chunk-W6JEMFAF.js +54 -0
- package/dist/chunk-XEJLBAXE.js +164 -0
- package/dist/chunk-Z7G3SIQH.js +270 -0
- package/dist/chunk-ZJPKS2MQ.js +101 -0
- package/dist/collections.cjs +797 -0
- package/dist/collections.d.cts +353 -0
- package/dist/collections.d.ts +353 -0
- package/dist/collections.js +17 -0
- package/dist/datetime.cjs +80 -0
- package/dist/datetime.d.cts +75 -0
- package/dist/datetime.d.ts +75 -0
- package/dist/datetime.js +24 -0
- package/dist/equals.cjs +121 -0
- package/dist/equals.d.cts +24 -0
- package/dist/equals.d.ts +24 -0
- package/dist/equals.js +8 -0
- package/dist/formatters.cjs +201 -0
- package/dist/formatters.d.cts +180 -0
- package/dist/formatters.d.ts +180 -0
- package/dist/formatters.js +48 -0
- package/dist/index.cjs +2906 -0
- package/dist/index.d.cts +120 -0
- package/dist/index.d.ts +120 -0
- package/dist/index.js +348 -0
- package/dist/number.cjs +279 -0
- package/dist/number.d.cts +177 -0
- package/dist/number.d.ts +177 -0
- package/dist/number.js +10 -0
- package/dist/obj.cjs +427 -0
- package/dist/obj.d.cts +177 -0
- package/dist/obj.d.ts +177 -0
- package/dist/obj.js +12 -0
- package/dist/php-arrays.cjs +954 -0
- package/dist/php-arrays.d.cts +256 -0
- package/dist/php-arrays.d.ts +256 -0
- package/dist/php-arrays.js +70 -0
- package/dist/runtime.cjs +134 -0
- package/dist/runtime.d.cts +90 -0
- package/dist/runtime.d.ts +90 -0
- package/dist/runtime.js +24 -0
- package/dist/schemas.cjs +86 -0
- package/dist/schemas.d.cts +108 -0
- package/dist/schemas.d.ts +108 -0
- package/dist/schemas.js +22 -0
- package/dist/str.cjs +499 -0
- package/dist/str.d.cts +282 -0
- package/dist/str.d.ts +282 -0
- package/dist/str.js +11 -0
- package/dist/types.cjs +18 -0
- package/dist/types.d.cts +13 -0
- package/dist/types.d.ts +13 -0
- package/dist/types.js +1 -0
- package/dist/validator.cjs +251 -0
- package/dist/validator.d.cts +99 -0
- package/dist/validator.d.ts +99 -0
- package/dist/validator.js +11 -0
- package/dist/validators.cjs +217 -0
- package/dist/validators.d.cts +216 -0
- package/dist/validators.d.ts +216 -0
- package/dist/validators.js +64 -0
- package/package.json +180 -0
- package/src/arrays.ts +316 -0
- package/src/collections.ts +866 -0
- package/src/datetime.ts +103 -0
- package/src/equals.ts +134 -0
- package/src/formatters.ts +342 -0
- package/src/index.ts +36 -0
- package/src/number.ts +281 -0
- package/src/obj.ts +303 -0
- package/src/php-arrays.ts +445 -0
- package/src/pipe.ts +29 -0
- package/src/runtime.ts +194 -0
- package/src/schemas.ts +136 -0
- package/src/str.ts +438 -0
- package/src/types.ts +13 -0
- package/src/validator.ts +157 -0
- package/src/validators.ts +359 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export { blank, filled, isArray, isBase64, isBlank, isBoolean, isDate, isEmail, isEmpty, isEven, isFalse, isFloat, isFunction, isInteger, isIp, isJson, isMacAddress, isNotEmpty, isNull, isNumber, isNumeric, isObject, isOdd, isPresent, isSet, isString, isTrue, isUndefined, isUrl, isUuid } from './validators.cjs';
|
|
2
|
+
export { camelCase, capitalize, kebabCase, normalizeString, numberFormat, slugify, snakeCase, strContainsAll, strContainsAny, strFinish, strLimit, strMask, strPadBoth, strPadLeft, strPadRight, strRemove, strReverse, strStart, strWordCount, strWords, studlyCase, titleCase } from './formatters.cjs';
|
|
3
|
+
export { arrayAdd, arrayCollapse, arrayDivide, arrayDot, arrayExcept, arrayFirst, arrayFlatten, arrayGet, arrayGroupBy, arrayHas, arrayOnly, arrayPluck, arrayUnique, arrayWhere } from './arrays.cjs';
|
|
4
|
+
export { Callback, EnhancedArray, EnhancedMap, Predicate, collect, collectMap, mapToObject, objectToMap } from './collections.cjs';
|
|
5
|
+
export { array_chunk, array_column, array_count_values, array_diff, array_filter, array_flip, array_intersect, array_key_exists, array_keys, array_map, array_merge, array_pop, array_product, array_push, array_rand, array_reduce, array_reverse, array_search, array_shift, array_slice, array_splice, array_sum, array_unique, array_unshift, php_array, range, rsort, shuffle, sort, uasort, uksort, usort } from './php-arrays.cjs';
|
|
6
|
+
export { dayjs, fromNow, isBetweenDates, isFuture, isPast, isToday, now, today, tomorrow, yesterday } from './datetime.cjs';
|
|
7
|
+
export { ApiResponse, ApiResponseSchema, DateSchema, Email, EmailSchema, PaginatedResponse, PaginatedResponseSchema, Pagination, PaginationSchema, Phone, PhoneSchema, Url, UrlSchema, safeValidateSchema, validateSchema } from './schemas.cjs';
|
|
8
|
+
export { diff, isEqual } from './equals.cjs';
|
|
9
|
+
export { NumberHelper, Numberable, num } from './number.cjs';
|
|
10
|
+
export { Obj, Objectable, obj } from './obj.cjs';
|
|
11
|
+
export { data_get, data_set, isRecord, optional, retry, tap, throw_if, throw_unless, value, when } from './runtime.cjs';
|
|
12
|
+
export { Str, Stringable, str } from './str.cjs';
|
|
13
|
+
export { DataContainer, GenericRecord } from './types.cjs';
|
|
14
|
+
export { ValidationInstance, Validator, validator } from './validator.cjs';
|
|
15
|
+
import 'dayjs';
|
|
16
|
+
import 'zod';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Functional pipe helper inspired by Laravel pipelines.
|
|
20
|
+
*
|
|
21
|
+
* @param {T} value The initial value to pipe
|
|
22
|
+
* @returns {Object} An object with through and value methods
|
|
23
|
+
*/
|
|
24
|
+
declare function pipe<T>(value: T): {
|
|
25
|
+
/**
|
|
26
|
+
* Pass the value through a callback.
|
|
27
|
+
*
|
|
28
|
+
* @param {Function} fn The callback function
|
|
29
|
+
* @returns {ReturnType<typeof pipe>} A new pipe instance with the result
|
|
30
|
+
*/
|
|
31
|
+
through<U>(fn: (input: T) => U): {
|
|
32
|
+
through<U_1>(fn: (input: U) => U_1): {
|
|
33
|
+
through<U_2>(fn: (input: U_1) => U_2): {
|
|
34
|
+
through<U_3>(fn: (input: U_2) => U_3): {
|
|
35
|
+
through<U_4>(fn: (input: U_3) => U_4): {
|
|
36
|
+
through<U_5>(fn: (input: U_4) => U_5): {
|
|
37
|
+
through<U_6>(fn: (input: U_5) => U_6): {
|
|
38
|
+
through<U_7>(fn: (input: U_6) => U_7): {
|
|
39
|
+
through<U_8>(fn: (input: U_7) => U_8): {
|
|
40
|
+
through<U_9>(fn: (input: U_8) => U_9): {
|
|
41
|
+
through<U_10>(fn: (input: U_9) => U_10): /*elided*/ any;
|
|
42
|
+
/**
|
|
43
|
+
* Get the current value of the pipe.
|
|
44
|
+
*
|
|
45
|
+
* @returns {T} The current value
|
|
46
|
+
*/
|
|
47
|
+
value(): U_9;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Get the current value of the pipe.
|
|
51
|
+
*
|
|
52
|
+
* @returns {T} The current value
|
|
53
|
+
*/
|
|
54
|
+
value(): U_8;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Get the current value of the pipe.
|
|
58
|
+
*
|
|
59
|
+
* @returns {T} The current value
|
|
60
|
+
*/
|
|
61
|
+
value(): U_7;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Get the current value of the pipe.
|
|
65
|
+
*
|
|
66
|
+
* @returns {T} The current value
|
|
67
|
+
*/
|
|
68
|
+
value(): U_6;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Get the current value of the pipe.
|
|
72
|
+
*
|
|
73
|
+
* @returns {T} The current value
|
|
74
|
+
*/
|
|
75
|
+
value(): U_5;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Get the current value of the pipe.
|
|
79
|
+
*
|
|
80
|
+
* @returns {T} The current value
|
|
81
|
+
*/
|
|
82
|
+
value(): U_4;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Get the current value of the pipe.
|
|
86
|
+
*
|
|
87
|
+
* @returns {T} The current value
|
|
88
|
+
*/
|
|
89
|
+
value(): U_3;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Get the current value of the pipe.
|
|
93
|
+
*
|
|
94
|
+
* @returns {T} The current value
|
|
95
|
+
*/
|
|
96
|
+
value(): U_2;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Get the current value of the pipe.
|
|
100
|
+
*
|
|
101
|
+
* @returns {T} The current value
|
|
102
|
+
*/
|
|
103
|
+
value(): U_1;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Get the current value of the pipe.
|
|
107
|
+
*
|
|
108
|
+
* @returns {T} The current value
|
|
109
|
+
*/
|
|
110
|
+
value(): U;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Get the current value of the pipe.
|
|
114
|
+
*
|
|
115
|
+
* @returns {T} The current value
|
|
116
|
+
*/
|
|
117
|
+
value(): T;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export { pipe };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export { blank, filled, isArray, isBase64, isBlank, isBoolean, isDate, isEmail, isEmpty, isEven, isFalse, isFloat, isFunction, isInteger, isIp, isJson, isMacAddress, isNotEmpty, isNull, isNumber, isNumeric, isObject, isOdd, isPresent, isSet, isString, isTrue, isUndefined, isUrl, isUuid } from './validators.js';
|
|
2
|
+
export { camelCase, capitalize, kebabCase, normalizeString, numberFormat, slugify, snakeCase, strContainsAll, strContainsAny, strFinish, strLimit, strMask, strPadBoth, strPadLeft, strPadRight, strRemove, strReverse, strStart, strWordCount, strWords, studlyCase, titleCase } from './formatters.js';
|
|
3
|
+
export { arrayAdd, arrayCollapse, arrayDivide, arrayDot, arrayExcept, arrayFirst, arrayFlatten, arrayGet, arrayGroupBy, arrayHas, arrayOnly, arrayPluck, arrayUnique, arrayWhere } from './arrays.js';
|
|
4
|
+
export { Callback, EnhancedArray, EnhancedMap, Predicate, collect, collectMap, mapToObject, objectToMap } from './collections.js';
|
|
5
|
+
export { array_chunk, array_column, array_count_values, array_diff, array_filter, array_flip, array_intersect, array_key_exists, array_keys, array_map, array_merge, array_pop, array_product, array_push, array_rand, array_reduce, array_reverse, array_search, array_shift, array_slice, array_splice, array_sum, array_unique, array_unshift, php_array, range, rsort, shuffle, sort, uasort, uksort, usort } from './php-arrays.js';
|
|
6
|
+
export { dayjs, fromNow, isBetweenDates, isFuture, isPast, isToday, now, today, tomorrow, yesterday } from './datetime.js';
|
|
7
|
+
export { ApiResponse, ApiResponseSchema, DateSchema, Email, EmailSchema, PaginatedResponse, PaginatedResponseSchema, Pagination, PaginationSchema, Phone, PhoneSchema, Url, UrlSchema, safeValidateSchema, validateSchema } from './schemas.js';
|
|
8
|
+
export { diff, isEqual } from './equals.js';
|
|
9
|
+
export { NumberHelper, Numberable, num } from './number.js';
|
|
10
|
+
export { Obj, Objectable, obj } from './obj.js';
|
|
11
|
+
export { data_get, data_set, isRecord, optional, retry, tap, throw_if, throw_unless, value, when } from './runtime.js';
|
|
12
|
+
export { Str, Stringable, str } from './str.js';
|
|
13
|
+
export { DataContainer, GenericRecord } from './types.js';
|
|
14
|
+
export { ValidationInstance, Validator, validator } from './validator.js';
|
|
15
|
+
import 'dayjs';
|
|
16
|
+
import 'zod';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Functional pipe helper inspired by Laravel pipelines.
|
|
20
|
+
*
|
|
21
|
+
* @param {T} value The initial value to pipe
|
|
22
|
+
* @returns {Object} An object with through and value methods
|
|
23
|
+
*/
|
|
24
|
+
declare function pipe<T>(value: T): {
|
|
25
|
+
/**
|
|
26
|
+
* Pass the value through a callback.
|
|
27
|
+
*
|
|
28
|
+
* @param {Function} fn The callback function
|
|
29
|
+
* @returns {ReturnType<typeof pipe>} A new pipe instance with the result
|
|
30
|
+
*/
|
|
31
|
+
through<U>(fn: (input: T) => U): {
|
|
32
|
+
through<U_1>(fn: (input: U) => U_1): {
|
|
33
|
+
through<U_2>(fn: (input: U_1) => U_2): {
|
|
34
|
+
through<U_3>(fn: (input: U_2) => U_3): {
|
|
35
|
+
through<U_4>(fn: (input: U_3) => U_4): {
|
|
36
|
+
through<U_5>(fn: (input: U_4) => U_5): {
|
|
37
|
+
through<U_6>(fn: (input: U_5) => U_6): {
|
|
38
|
+
through<U_7>(fn: (input: U_6) => U_7): {
|
|
39
|
+
through<U_8>(fn: (input: U_7) => U_8): {
|
|
40
|
+
through<U_9>(fn: (input: U_8) => U_9): {
|
|
41
|
+
through<U_10>(fn: (input: U_9) => U_10): /*elided*/ any;
|
|
42
|
+
/**
|
|
43
|
+
* Get the current value of the pipe.
|
|
44
|
+
*
|
|
45
|
+
* @returns {T} The current value
|
|
46
|
+
*/
|
|
47
|
+
value(): U_9;
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Get the current value of the pipe.
|
|
51
|
+
*
|
|
52
|
+
* @returns {T} The current value
|
|
53
|
+
*/
|
|
54
|
+
value(): U_8;
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Get the current value of the pipe.
|
|
58
|
+
*
|
|
59
|
+
* @returns {T} The current value
|
|
60
|
+
*/
|
|
61
|
+
value(): U_7;
|
|
62
|
+
};
|
|
63
|
+
/**
|
|
64
|
+
* Get the current value of the pipe.
|
|
65
|
+
*
|
|
66
|
+
* @returns {T} The current value
|
|
67
|
+
*/
|
|
68
|
+
value(): U_6;
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* Get the current value of the pipe.
|
|
72
|
+
*
|
|
73
|
+
* @returns {T} The current value
|
|
74
|
+
*/
|
|
75
|
+
value(): U_5;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Get the current value of the pipe.
|
|
79
|
+
*
|
|
80
|
+
* @returns {T} The current value
|
|
81
|
+
*/
|
|
82
|
+
value(): U_4;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Get the current value of the pipe.
|
|
86
|
+
*
|
|
87
|
+
* @returns {T} The current value
|
|
88
|
+
*/
|
|
89
|
+
value(): U_3;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* Get the current value of the pipe.
|
|
93
|
+
*
|
|
94
|
+
* @returns {T} The current value
|
|
95
|
+
*/
|
|
96
|
+
value(): U_2;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Get the current value of the pipe.
|
|
100
|
+
*
|
|
101
|
+
* @returns {T} The current value
|
|
102
|
+
*/
|
|
103
|
+
value(): U_1;
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* Get the current value of the pipe.
|
|
107
|
+
*
|
|
108
|
+
* @returns {T} The current value
|
|
109
|
+
*/
|
|
110
|
+
value(): U;
|
|
111
|
+
};
|
|
112
|
+
/**
|
|
113
|
+
* Get the current value of the pipe.
|
|
114
|
+
*
|
|
115
|
+
* @returns {T} The current value
|
|
116
|
+
*/
|
|
117
|
+
value(): T;
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export { pipe };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Str,
|
|
3
|
+
Stringable,
|
|
4
|
+
str
|
|
5
|
+
} from "./chunk-27YHP2CK.js";
|
|
6
|
+
import {
|
|
7
|
+
ValidationInstance,
|
|
8
|
+
Validator,
|
|
9
|
+
validator
|
|
10
|
+
} from "./chunk-IPP7PA6H.js";
|
|
11
|
+
import {
|
|
12
|
+
NumberHelper,
|
|
13
|
+
Numberable,
|
|
14
|
+
num
|
|
15
|
+
} from "./chunk-G7ZJ23DW.js";
|
|
16
|
+
import {
|
|
17
|
+
Obj,
|
|
18
|
+
Objectable,
|
|
19
|
+
obj
|
|
20
|
+
} from "./chunk-Z7G3SIQH.js";
|
|
21
|
+
import {
|
|
22
|
+
data_get,
|
|
23
|
+
data_set,
|
|
24
|
+
isRecord,
|
|
25
|
+
optional,
|
|
26
|
+
retry,
|
|
27
|
+
tap,
|
|
28
|
+
throw_if,
|
|
29
|
+
throw_unless,
|
|
30
|
+
value,
|
|
31
|
+
when
|
|
32
|
+
} from "./chunk-ZJPKS2MQ.js";
|
|
33
|
+
import "./chunk-6F4PWJZI.js";
|
|
34
|
+
import {
|
|
35
|
+
blank,
|
|
36
|
+
filled,
|
|
37
|
+
isArray,
|
|
38
|
+
isBase64,
|
|
39
|
+
isBlank,
|
|
40
|
+
isBoolean,
|
|
41
|
+
isDate,
|
|
42
|
+
isEmail,
|
|
43
|
+
isEmpty,
|
|
44
|
+
isEven,
|
|
45
|
+
isFalse,
|
|
46
|
+
isFloat,
|
|
47
|
+
isFunction,
|
|
48
|
+
isInteger,
|
|
49
|
+
isIp,
|
|
50
|
+
isJson,
|
|
51
|
+
isMacAddress,
|
|
52
|
+
isNotEmpty,
|
|
53
|
+
isNull,
|
|
54
|
+
isNumber,
|
|
55
|
+
isNumeric,
|
|
56
|
+
isObject,
|
|
57
|
+
isOdd,
|
|
58
|
+
isPresent,
|
|
59
|
+
isSet,
|
|
60
|
+
isString,
|
|
61
|
+
isTrue,
|
|
62
|
+
isUndefined,
|
|
63
|
+
isUrl,
|
|
64
|
+
isUuid
|
|
65
|
+
} from "./chunk-XEJLBAXE.js";
|
|
66
|
+
import {
|
|
67
|
+
camelCase,
|
|
68
|
+
capitalize,
|
|
69
|
+
kebabCase,
|
|
70
|
+
normalizeString,
|
|
71
|
+
numberFormat,
|
|
72
|
+
slugify,
|
|
73
|
+
snakeCase,
|
|
74
|
+
strContainsAll,
|
|
75
|
+
strContainsAny,
|
|
76
|
+
strFinish,
|
|
77
|
+
strLimit,
|
|
78
|
+
strMask,
|
|
79
|
+
strPadBoth,
|
|
80
|
+
strPadLeft,
|
|
81
|
+
strPadRight,
|
|
82
|
+
strRemove,
|
|
83
|
+
strReverse,
|
|
84
|
+
strStart,
|
|
85
|
+
strWordCount,
|
|
86
|
+
strWords,
|
|
87
|
+
studlyCase,
|
|
88
|
+
titleCase
|
|
89
|
+
} from "./chunk-F6RSTW65.js";
|
|
90
|
+
import {
|
|
91
|
+
dayjs,
|
|
92
|
+
fromNow,
|
|
93
|
+
isBetweenDates,
|
|
94
|
+
isFuture,
|
|
95
|
+
isPast,
|
|
96
|
+
isToday,
|
|
97
|
+
now,
|
|
98
|
+
today,
|
|
99
|
+
tomorrow,
|
|
100
|
+
yesterday
|
|
101
|
+
} from "./chunk-3WNRYKPG.js";
|
|
102
|
+
import {
|
|
103
|
+
arrayAdd,
|
|
104
|
+
arrayCollapse,
|
|
105
|
+
arrayDivide,
|
|
106
|
+
arrayDot,
|
|
107
|
+
arrayExcept,
|
|
108
|
+
arrayFirst,
|
|
109
|
+
arrayFlatten,
|
|
110
|
+
arrayGet,
|
|
111
|
+
arrayGroupBy,
|
|
112
|
+
arrayHas,
|
|
113
|
+
arrayOnly,
|
|
114
|
+
arrayPluck,
|
|
115
|
+
arrayUnique,
|
|
116
|
+
arrayWhere
|
|
117
|
+
} from "./chunk-7SXRFZBB.js";
|
|
118
|
+
import {
|
|
119
|
+
array_chunk,
|
|
120
|
+
array_column,
|
|
121
|
+
array_count_values,
|
|
122
|
+
array_diff,
|
|
123
|
+
array_filter,
|
|
124
|
+
array_flip,
|
|
125
|
+
array_intersect,
|
|
126
|
+
array_key_exists,
|
|
127
|
+
array_keys,
|
|
128
|
+
array_map,
|
|
129
|
+
array_merge,
|
|
130
|
+
array_pop,
|
|
131
|
+
array_product,
|
|
132
|
+
array_push,
|
|
133
|
+
array_rand,
|
|
134
|
+
array_reduce,
|
|
135
|
+
array_reverse,
|
|
136
|
+
array_search,
|
|
137
|
+
array_shift,
|
|
138
|
+
array_slice,
|
|
139
|
+
array_splice,
|
|
140
|
+
array_sum,
|
|
141
|
+
array_unique,
|
|
142
|
+
array_unshift,
|
|
143
|
+
php_array,
|
|
144
|
+
range,
|
|
145
|
+
rsort,
|
|
146
|
+
shuffle,
|
|
147
|
+
sort,
|
|
148
|
+
uasort,
|
|
149
|
+
uksort,
|
|
150
|
+
usort
|
|
151
|
+
} from "./chunk-42CHLXT7.js";
|
|
152
|
+
import {
|
|
153
|
+
EnhancedArray,
|
|
154
|
+
EnhancedMap,
|
|
155
|
+
collect,
|
|
156
|
+
collectMap,
|
|
157
|
+
mapToObject,
|
|
158
|
+
objectToMap
|
|
159
|
+
} from "./chunk-TY75OOIQ.js";
|
|
160
|
+
import {
|
|
161
|
+
diff,
|
|
162
|
+
isEqual
|
|
163
|
+
} from "./chunk-LDSWHSRX.js";
|
|
164
|
+
import {
|
|
165
|
+
ApiResponseSchema,
|
|
166
|
+
DateSchema,
|
|
167
|
+
EmailSchema,
|
|
168
|
+
PaginatedResponseSchema,
|
|
169
|
+
PaginationSchema,
|
|
170
|
+
PhoneSchema,
|
|
171
|
+
UrlSchema,
|
|
172
|
+
safeValidateSchema,
|
|
173
|
+
validateSchema
|
|
174
|
+
} from "./chunk-W6JEMFAF.js";
|
|
175
|
+
|
|
176
|
+
// src/pipe.ts
|
|
177
|
+
function pipe(value2) {
|
|
178
|
+
return {
|
|
179
|
+
/**
|
|
180
|
+
* Pass the value through a callback.
|
|
181
|
+
*
|
|
182
|
+
* @param {Function} fn The callback function
|
|
183
|
+
* @returns {ReturnType<typeof pipe>} A new pipe instance with the result
|
|
184
|
+
*/
|
|
185
|
+
through(fn) {
|
|
186
|
+
const result = fn(value2);
|
|
187
|
+
return pipe(result);
|
|
188
|
+
},
|
|
189
|
+
/**
|
|
190
|
+
* Get the current value of the pipe.
|
|
191
|
+
*
|
|
192
|
+
* @returns {T} The current value
|
|
193
|
+
*/
|
|
194
|
+
value() {
|
|
195
|
+
return value2;
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
export {
|
|
200
|
+
ApiResponseSchema,
|
|
201
|
+
DateSchema,
|
|
202
|
+
EmailSchema,
|
|
203
|
+
EnhancedArray,
|
|
204
|
+
EnhancedMap,
|
|
205
|
+
NumberHelper,
|
|
206
|
+
Numberable,
|
|
207
|
+
Obj,
|
|
208
|
+
Objectable,
|
|
209
|
+
PaginatedResponseSchema,
|
|
210
|
+
PaginationSchema,
|
|
211
|
+
PhoneSchema,
|
|
212
|
+
Str,
|
|
213
|
+
Stringable,
|
|
214
|
+
UrlSchema,
|
|
215
|
+
ValidationInstance,
|
|
216
|
+
Validator,
|
|
217
|
+
arrayAdd,
|
|
218
|
+
arrayCollapse,
|
|
219
|
+
arrayDivide,
|
|
220
|
+
arrayDot,
|
|
221
|
+
arrayExcept,
|
|
222
|
+
arrayFirst,
|
|
223
|
+
arrayFlatten,
|
|
224
|
+
arrayGet,
|
|
225
|
+
arrayGroupBy,
|
|
226
|
+
arrayHas,
|
|
227
|
+
arrayOnly,
|
|
228
|
+
arrayPluck,
|
|
229
|
+
arrayUnique,
|
|
230
|
+
arrayWhere,
|
|
231
|
+
array_chunk,
|
|
232
|
+
array_column,
|
|
233
|
+
array_count_values,
|
|
234
|
+
array_diff,
|
|
235
|
+
array_filter,
|
|
236
|
+
array_flip,
|
|
237
|
+
array_intersect,
|
|
238
|
+
array_key_exists,
|
|
239
|
+
array_keys,
|
|
240
|
+
array_map,
|
|
241
|
+
array_merge,
|
|
242
|
+
array_pop,
|
|
243
|
+
array_product,
|
|
244
|
+
array_push,
|
|
245
|
+
array_rand,
|
|
246
|
+
array_reduce,
|
|
247
|
+
array_reverse,
|
|
248
|
+
array_search,
|
|
249
|
+
array_shift,
|
|
250
|
+
array_slice,
|
|
251
|
+
array_splice,
|
|
252
|
+
array_sum,
|
|
253
|
+
array_unique,
|
|
254
|
+
array_unshift,
|
|
255
|
+
blank,
|
|
256
|
+
camelCase,
|
|
257
|
+
capitalize,
|
|
258
|
+
collect,
|
|
259
|
+
collectMap,
|
|
260
|
+
data_get,
|
|
261
|
+
data_set,
|
|
262
|
+
dayjs,
|
|
263
|
+
diff,
|
|
264
|
+
filled,
|
|
265
|
+
fromNow,
|
|
266
|
+
isArray,
|
|
267
|
+
isBase64,
|
|
268
|
+
isBetweenDates,
|
|
269
|
+
isBlank,
|
|
270
|
+
isBoolean,
|
|
271
|
+
isDate,
|
|
272
|
+
isEmail,
|
|
273
|
+
isEmpty,
|
|
274
|
+
isEqual,
|
|
275
|
+
isEven,
|
|
276
|
+
isFalse,
|
|
277
|
+
isFloat,
|
|
278
|
+
isFunction,
|
|
279
|
+
isFuture,
|
|
280
|
+
isInteger,
|
|
281
|
+
isIp,
|
|
282
|
+
isJson,
|
|
283
|
+
isMacAddress,
|
|
284
|
+
isNotEmpty,
|
|
285
|
+
isNull,
|
|
286
|
+
isNumber,
|
|
287
|
+
isNumeric,
|
|
288
|
+
isObject,
|
|
289
|
+
isOdd,
|
|
290
|
+
isPast,
|
|
291
|
+
isPresent,
|
|
292
|
+
isRecord,
|
|
293
|
+
isSet,
|
|
294
|
+
isString,
|
|
295
|
+
isToday,
|
|
296
|
+
isTrue,
|
|
297
|
+
isUndefined,
|
|
298
|
+
isUrl,
|
|
299
|
+
isUuid,
|
|
300
|
+
kebabCase,
|
|
301
|
+
mapToObject,
|
|
302
|
+
normalizeString,
|
|
303
|
+
now,
|
|
304
|
+
num,
|
|
305
|
+
numberFormat,
|
|
306
|
+
obj,
|
|
307
|
+
objectToMap,
|
|
308
|
+
optional,
|
|
309
|
+
php_array,
|
|
310
|
+
pipe,
|
|
311
|
+
range,
|
|
312
|
+
retry,
|
|
313
|
+
rsort,
|
|
314
|
+
safeValidateSchema,
|
|
315
|
+
shuffle,
|
|
316
|
+
slugify,
|
|
317
|
+
snakeCase,
|
|
318
|
+
sort,
|
|
319
|
+
str,
|
|
320
|
+
strContainsAll,
|
|
321
|
+
strContainsAny,
|
|
322
|
+
strFinish,
|
|
323
|
+
strLimit,
|
|
324
|
+
strMask,
|
|
325
|
+
strPadBoth,
|
|
326
|
+
strPadLeft,
|
|
327
|
+
strPadRight,
|
|
328
|
+
strRemove,
|
|
329
|
+
strReverse,
|
|
330
|
+
strStart,
|
|
331
|
+
strWordCount,
|
|
332
|
+
strWords,
|
|
333
|
+
studlyCase,
|
|
334
|
+
tap,
|
|
335
|
+
throw_if,
|
|
336
|
+
throw_unless,
|
|
337
|
+
titleCase,
|
|
338
|
+
today,
|
|
339
|
+
tomorrow,
|
|
340
|
+
uasort,
|
|
341
|
+
uksort,
|
|
342
|
+
usort,
|
|
343
|
+
validateSchema,
|
|
344
|
+
validator,
|
|
345
|
+
value,
|
|
346
|
+
when,
|
|
347
|
+
yesterday
|
|
348
|
+
};
|