@opfr/utils-lang 0.0.3 → 0.0.4

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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ export declare const paginate: <T>(array: T[], pageSize: number) => T[][];
2
+ export declare const groupBy: <T extends object, K extends string | number>(array: T[], key: (i: T) => K) => Record<K, T[]>;
3
+ export declare const sortBy: <T extends object, K extends string | number>(array: T[], key: (i: T) => K) => T[];
4
+ export declare const mutuallyInclusive: <T>(array1: T[], array2: T[], key?: (i: T) => T | string | number) => T[];
5
+ export declare const exclude: <T>(array: T[], exclude: T[], key?: (i: T) => T | string | number) => T[];
6
+ export declare const unique: <T extends object, K extends string | number>(array: T[], key: (i: T) => K) => K[];
package/dist/date.d.ts ADDED
@@ -0,0 +1,7 @@
1
+ export declare const isValidDate: (date: Date | string) => boolean;
2
+ export declare const dateDiff: (date1: Date, date2: Date) => number;
3
+ export declare const formatDate: (date: Date) => string;
4
+ export declare const formatDateWithDay: (date: Date) => string;
5
+ export declare const sameDay: (d1: Date, d2: Date, compareYear?: boolean) => boolean;
6
+ export declare const yesterday: () => Date;
7
+ export declare const precise: (timestamp: number) => string | undefined;
@@ -0,0 +1,3 @@
1
+ export declare const isDuration: (str: string | null) => boolean;
2
+ export declare const durationToMs: (str: string) => number | null | undefined;
3
+ export declare const formatDuration: (str: string) => string | null | undefined;
@@ -0,0 +1,116 @@
1
+ export declare const emojis: {
2
+ d1: string;
3
+ d2: string;
4
+ d3: string;
5
+ d4: string;
6
+ d5: string;
7
+ d6: string;
8
+ revolutionary: string;
9
+ pirate: string;
10
+ marine: string;
11
+ berry: string;
12
+ xp: string;
13
+ success: string;
14
+ paper: string;
15
+ rock: string;
16
+ scissor: string;
17
+ pray: string;
18
+ gun: string;
19
+ promise: string;
20
+ love: string;
21
+ note: string;
22
+ watching: string;
23
+ card: string;
24
+ cards: {
25
+ spades: {
26
+ 1: string;
27
+ 2: string;
28
+ 3: string;
29
+ 4: string;
30
+ 5: string;
31
+ 6: string;
32
+ 7: string;
33
+ 8: string;
34
+ 9: string;
35
+ 10: string;
36
+ J: string;
37
+ Q: string;
38
+ K: string;
39
+ };
40
+ diamonds: {
41
+ 1: string;
42
+ 2: string;
43
+ 3: string;
44
+ 4: string;
45
+ 5: string;
46
+ 6: string;
47
+ 7: string;
48
+ 8: string;
49
+ 9: string;
50
+ 10: string;
51
+ J: string;
52
+ Q: string;
53
+ K: string;
54
+ };
55
+ hearts: {
56
+ 1: string;
57
+ 2: string;
58
+ 3: string;
59
+ 4: string;
60
+ 5: string;
61
+ 6: string;
62
+ 7: string;
63
+ 8: string;
64
+ 9: string;
65
+ 10: string;
66
+ J: string;
67
+ Q: string;
68
+ K: string;
69
+ };
70
+ clubs: {
71
+ 1: string;
72
+ 2: string;
73
+ 3: string;
74
+ 4: string;
75
+ 5: string;
76
+ 6: string;
77
+ 7: string;
78
+ 8: string;
79
+ 9: string;
80
+ 10: string;
81
+ J: string;
82
+ Q: string;
83
+ K: string;
84
+ };
85
+ };
86
+ factions: {
87
+ b_citizen_Bronze: string;
88
+ b_citizen_Silver: string;
89
+ b_citizen_Gold: string;
90
+ b_citizen_Platinum: string;
91
+ b_citizen_Diamond: string;
92
+ b_marine_Bronze: string;
93
+ b_marine_Silver: string;
94
+ b_marine_Gold: string;
95
+ b_marine_Platinum: string;
96
+ b_marine_Diamond: string;
97
+ b_revolutionary_Bronze: string;
98
+ b_revolutionary_Silver: string;
99
+ b_revolutionary_Gold: string;
100
+ b_revolutionary_Platinum: string;
101
+ b_revolutionary_Diamond: string;
102
+ b_pirate_Bronze: string;
103
+ b_pirate_Silver: string;
104
+ b_pirate_Gold: string;
105
+ b_pirate_Platinum: string;
106
+ b_pirate_Diamond: string;
107
+ };
108
+ item_background: string;
109
+ item_title: string;
110
+ item_lootbox1: string;
111
+ item_lootbox2: string;
112
+ item_lootbox3: string;
113
+ item_bottle_xp: string;
114
+ item_boost_week: string;
115
+ item_boost_day: string;
116
+ };
@@ -0,0 +1,6 @@
1
+ export * from './array';
2
+ export * from './date';
3
+ export * from './duration';
4
+ export * from './emojis';
5
+ export * from './number';
6
+ export * from './string';
@@ -0,0 +1,2 @@
1
+ export declare const formatNumber: (nb: number) => string;
2
+ export declare const randomBetween: <T extends number = number>(min: number, max: number) => T;
@@ -0,0 +1,11 @@
1
+ export declare const TIGHT_SPACE: string;
2
+ export declare const WIDE_SPACE: string;
3
+ export declare const fillWithTightSpaces: (str: string) => string;
4
+ export declare const fillWithWideSpaces: (str: string) => string;
5
+ export declare const ellipsis: (str: string, limit: number) => string;
6
+ export declare const capitalize: (str: string) => string;
7
+ export declare const capitalizeAllWords: (str: string) => string;
8
+ export declare const isPositiveInteger: (str: string) => boolean;
9
+ export declare const numberToOrdinal: (nb: number) => string | null;
10
+ export declare const trim: (str: string) => string;
11
+ export declare const breakWords: (str: string) => string[];
@@ -0,0 +1 @@
1
+ export * from './index'