@mongez/reinforcements 1.0.1

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.
Files changed (189) hide show
  1. package/cjs/arr.d.ts +268 -0
  2. package/cjs/arr.d.ts.map +1 -0
  3. package/cjs/arr.js +1 -0
  4. package/cjs/contracts/arrayable.d.ts +337 -0
  5. package/cjs/contracts/arrayable.d.ts.map +1 -0
  6. package/cjs/contracts/iterable.d.ts +9 -0
  7. package/cjs/contracts/iterable.d.ts.map +1 -0
  8. package/cjs/index.d.ts +24 -0
  9. package/cjs/index.d.ts.map +1 -0
  10. package/cjs/index.js +1 -0
  11. package/cjs/obj.d.ts +57 -0
  12. package/cjs/obj.d.ts.map +1 -0
  13. package/cjs/obj.js +1 -0
  14. package/cjs/utilities/escapeRegex.d.ts +5 -0
  15. package/cjs/utilities/escapeRegex.d.ts.map +1 -0
  16. package/cjs/utilities/escapeRegex.js +1 -0
  17. package/cjs/utilities/object/clone.d.ts +2 -0
  18. package/cjs/utilities/object/clone.d.ts.map +1 -0
  19. package/cjs/utilities/object/clone.js +1 -0
  20. package/cjs/utilities/object/get.d.ts +10 -0
  21. package/cjs/utilities/object/get.d.ts.map +1 -0
  22. package/cjs/utilities/object/get.js +1 -0
  23. package/cjs/utilities/object/merge.d.ts +2 -0
  24. package/cjs/utilities/object/merge.d.ts.map +1 -0
  25. package/cjs/utilities/object/merge.js +1 -0
  26. package/cjs/utilities/object/only.d.ts +9 -0
  27. package/cjs/utilities/object/only.d.ts.map +1 -0
  28. package/cjs/utilities/object/only.js +1 -0
  29. package/cjs/utilities/object/set.d.ts +11 -0
  30. package/cjs/utilities/object/set.d.ts.map +1 -0
  31. package/cjs/utilities/object/set.js +1 -0
  32. package/cjs/utilities/object/sort.d.ts +8 -0
  33. package/cjs/utilities/object/sort.d.ts.map +1 -0
  34. package/cjs/utilities/object/sort.js +1 -0
  35. package/cjs/utilities/random.d.ts +27 -0
  36. package/cjs/utilities/random.d.ts.map +1 -0
  37. package/cjs/utilities/random.js +1 -0
  38. package/cjs/utilities/str/capitalize.d.ts +7 -0
  39. package/cjs/utilities/str/capitalize.d.ts.map +1 -0
  40. package/cjs/utilities/str/capitalize.js +1 -0
  41. package/cjs/utilities/str/extension.d.ts +5 -0
  42. package/cjs/utilities/str/extension.d.ts.map +1 -0
  43. package/cjs/utilities/str/extension.js +1 -0
  44. package/cjs/utilities/str/ltrim.d.ts +8 -0
  45. package/cjs/utilities/str/ltrim.d.ts.map +1 -0
  46. package/cjs/utilities/str/ltrim.js +1 -0
  47. package/cjs/utilities/str/readMoreChars.d.ts +6 -0
  48. package/cjs/utilities/str/readMoreChars.d.ts.map +1 -0
  49. package/cjs/utilities/str/readMoreChars.js +1 -0
  50. package/cjs/utilities/str/readMoreWords.d.ts +6 -0
  51. package/cjs/utilities/str/readMoreWords.d.ts.map +1 -0
  52. package/cjs/utilities/str/readMoreWords.js +1 -0
  53. package/cjs/utilities/str/removeFirst.d.ts +8 -0
  54. package/cjs/utilities/str/removeFirst.d.ts.map +1 -0
  55. package/cjs/utilities/str/removeFirst.js +1 -0
  56. package/cjs/utilities/str/removeLast.d.ts +8 -0
  57. package/cjs/utilities/str/removeLast.d.ts.map +1 -0
  58. package/cjs/utilities/str/removeLast.js +1 -0
  59. package/cjs/utilities/str/repeatsOf.d.ts +8 -0
  60. package/cjs/utilities/str/repeatsOf.d.ts.map +1 -0
  61. package/cjs/utilities/str/repeatsOf.js +1 -0
  62. package/cjs/utilities/str/replaceAll.d.ts +9 -0
  63. package/cjs/utilities/str/replaceAll.d.ts.map +1 -0
  64. package/cjs/utilities/str/replaceAll.js +1 -0
  65. package/cjs/utilities/str/replaceFirst.d.ts +9 -0
  66. package/cjs/utilities/str/replaceFirst.d.ts.map +1 -0
  67. package/cjs/utilities/str/replaceFirst.js +1 -0
  68. package/cjs/utilities/str/replaceLast.d.ts +9 -0
  69. package/cjs/utilities/str/replaceLast.d.ts.map +1 -0
  70. package/cjs/utilities/str/replaceLast.js +1 -0
  71. package/cjs/utilities/str/rtrim.d.ts +8 -0
  72. package/cjs/utilities/str/rtrim.d.ts.map +1 -0
  73. package/cjs/utilities/str/rtrim.js +1 -0
  74. package/cjs/utilities/str/sprintf.d.ts +3 -0
  75. package/cjs/utilities/str/sprintf.d.ts.map +1 -0
  76. package/cjs/utilities/str/sprintf.js +1 -0
  77. package/cjs/utilities/str/toCamelCase.d.ts +2 -0
  78. package/cjs/utilities/str/toCamelCase.d.ts.map +1 -0
  79. package/cjs/utilities/str/toCamelCase.js +1 -0
  80. package/cjs/utilities/str/toInputName.d.ts +9 -0
  81. package/cjs/utilities/str/toInputName.d.ts.map +1 -0
  82. package/cjs/utilities/str/toInputName.js +1 -0
  83. package/cjs/utilities/str/toSnakeCase.d.ts +8 -0
  84. package/cjs/utilities/str/toSnakeCase.d.ts.map +1 -0
  85. package/cjs/utilities/str/toSnakeCase.js +1 -0
  86. package/cjs/utilities/str/toStudlyCase.d.ts +10 -0
  87. package/cjs/utilities/str/toStudlyCase.d.ts.map +1 -0
  88. package/cjs/utilities/str/toStudlyCase.js +1 -0
  89. package/cjs/utilities/str/trim.d.ts +8 -0
  90. package/cjs/utilities/str/trim.d.ts.map +1 -0
  91. package/cjs/utilities/str/trim.js +1 -0
  92. package/cjs/utilities/str/ucfirst.d.ts +7 -0
  93. package/cjs/utilities/str/ucfirst.d.ts.map +1 -0
  94. package/cjs/utilities/str/ucfirst.js +1 -0
  95. package/esm/arr.d.ts +268 -0
  96. package/esm/arr.d.ts.map +1 -0
  97. package/esm/arr.js +1 -0
  98. package/esm/contracts/arrayable.d.ts +337 -0
  99. package/esm/contracts/arrayable.d.ts.map +1 -0
  100. package/esm/contracts/iterable.d.ts +9 -0
  101. package/esm/contracts/iterable.d.ts.map +1 -0
  102. package/esm/index.d.ts +24 -0
  103. package/esm/index.d.ts.map +1 -0
  104. package/esm/index.js +1 -0
  105. package/esm/obj.d.ts +57 -0
  106. package/esm/obj.d.ts.map +1 -0
  107. package/esm/obj.js +1 -0
  108. package/esm/utilities/escapeRegex.d.ts +5 -0
  109. package/esm/utilities/escapeRegex.d.ts.map +1 -0
  110. package/esm/utilities/escapeRegex.js +1 -0
  111. package/esm/utilities/object/clone.d.ts +2 -0
  112. package/esm/utilities/object/clone.d.ts.map +1 -0
  113. package/esm/utilities/object/clone.js +1 -0
  114. package/esm/utilities/object/get.d.ts +10 -0
  115. package/esm/utilities/object/get.d.ts.map +1 -0
  116. package/esm/utilities/object/get.js +1 -0
  117. package/esm/utilities/object/merge.d.ts +2 -0
  118. package/esm/utilities/object/merge.d.ts.map +1 -0
  119. package/esm/utilities/object/merge.js +1 -0
  120. package/esm/utilities/object/only.d.ts +9 -0
  121. package/esm/utilities/object/only.d.ts.map +1 -0
  122. package/esm/utilities/object/only.js +1 -0
  123. package/esm/utilities/object/set.d.ts +11 -0
  124. package/esm/utilities/object/set.d.ts.map +1 -0
  125. package/esm/utilities/object/set.js +1 -0
  126. package/esm/utilities/object/sort.d.ts +8 -0
  127. package/esm/utilities/object/sort.d.ts.map +1 -0
  128. package/esm/utilities/object/sort.js +1 -0
  129. package/esm/utilities/random.d.ts +27 -0
  130. package/esm/utilities/random.d.ts.map +1 -0
  131. package/esm/utilities/random.js +1 -0
  132. package/esm/utilities/str/capitalize.d.ts +7 -0
  133. package/esm/utilities/str/capitalize.d.ts.map +1 -0
  134. package/esm/utilities/str/capitalize.js +1 -0
  135. package/esm/utilities/str/extension.d.ts +5 -0
  136. package/esm/utilities/str/extension.d.ts.map +1 -0
  137. package/esm/utilities/str/extension.js +1 -0
  138. package/esm/utilities/str/ltrim.d.ts +8 -0
  139. package/esm/utilities/str/ltrim.d.ts.map +1 -0
  140. package/esm/utilities/str/ltrim.js +1 -0
  141. package/esm/utilities/str/readMoreChars.d.ts +6 -0
  142. package/esm/utilities/str/readMoreChars.d.ts.map +1 -0
  143. package/esm/utilities/str/readMoreChars.js +1 -0
  144. package/esm/utilities/str/readMoreWords.d.ts +6 -0
  145. package/esm/utilities/str/readMoreWords.d.ts.map +1 -0
  146. package/esm/utilities/str/readMoreWords.js +1 -0
  147. package/esm/utilities/str/removeFirst.d.ts +8 -0
  148. package/esm/utilities/str/removeFirst.d.ts.map +1 -0
  149. package/esm/utilities/str/removeFirst.js +1 -0
  150. package/esm/utilities/str/removeLast.d.ts +8 -0
  151. package/esm/utilities/str/removeLast.d.ts.map +1 -0
  152. package/esm/utilities/str/removeLast.js +1 -0
  153. package/esm/utilities/str/repeatsOf.d.ts +8 -0
  154. package/esm/utilities/str/repeatsOf.d.ts.map +1 -0
  155. package/esm/utilities/str/repeatsOf.js +1 -0
  156. package/esm/utilities/str/replaceAll.d.ts +9 -0
  157. package/esm/utilities/str/replaceAll.d.ts.map +1 -0
  158. package/esm/utilities/str/replaceAll.js +1 -0
  159. package/esm/utilities/str/replaceFirst.d.ts +9 -0
  160. package/esm/utilities/str/replaceFirst.d.ts.map +1 -0
  161. package/esm/utilities/str/replaceFirst.js +1 -0
  162. package/esm/utilities/str/replaceLast.d.ts +9 -0
  163. package/esm/utilities/str/replaceLast.d.ts.map +1 -0
  164. package/esm/utilities/str/replaceLast.js +1 -0
  165. package/esm/utilities/str/rtrim.d.ts +8 -0
  166. package/esm/utilities/str/rtrim.d.ts.map +1 -0
  167. package/esm/utilities/str/rtrim.js +1 -0
  168. package/esm/utilities/str/sprintf.d.ts +3 -0
  169. package/esm/utilities/str/sprintf.d.ts.map +1 -0
  170. package/esm/utilities/str/sprintf.js +1 -0
  171. package/esm/utilities/str/toCamelCase.d.ts +2 -0
  172. package/esm/utilities/str/toCamelCase.d.ts.map +1 -0
  173. package/esm/utilities/str/toCamelCase.js +1 -0
  174. package/esm/utilities/str/toInputName.d.ts +9 -0
  175. package/esm/utilities/str/toInputName.d.ts.map +1 -0
  176. package/esm/utilities/str/toInputName.js +1 -0
  177. package/esm/utilities/str/toSnakeCase.d.ts +8 -0
  178. package/esm/utilities/str/toSnakeCase.d.ts.map +1 -0
  179. package/esm/utilities/str/toSnakeCase.js +1 -0
  180. package/esm/utilities/str/toStudlyCase.d.ts +10 -0
  181. package/esm/utilities/str/toStudlyCase.d.ts.map +1 -0
  182. package/esm/utilities/str/toStudlyCase.js +1 -0
  183. package/esm/utilities/str/trim.d.ts +8 -0
  184. package/esm/utilities/str/trim.d.ts.map +1 -0
  185. package/esm/utilities/str/trim.js +1 -0
  186. package/esm/utilities/str/ucfirst.d.ts +7 -0
  187. package/esm/utilities/str/ucfirst.d.ts.map +1 -0
  188. package/esm/utilities/str/ucfirst.js +1 -0
  189. package/package.json +19 -0
package/cjs/arr.d.ts ADDED
@@ -0,0 +1,268 @@
1
+ import Arrayable from "./contracts/arrayable";
2
+ declare type ArrayType = number | string | object | any;
3
+ declare type ArrayCallback<T> = (value: T, index: number, array: T[]) => any;
4
+ export default class Arr<T> implements Arrayable<T> {
5
+ /**
6
+ * Counter of array;
7
+ *
8
+ * @type {number}
9
+ */
10
+ private counter;
11
+ /**
12
+ * {@inheritdoc}
13
+ */
14
+ private items;
15
+ /**
16
+ * Constructor
17
+ *
18
+ * @param {array} items
19
+ */
20
+ constructor(items?: Array<ArrayType>);
21
+ /**
22
+ * {@inheritdoc}
23
+ */
24
+ min(key?: string): number;
25
+ /**
26
+ * {@inheritdoc}
27
+ */
28
+ max(key?: string): number;
29
+ /**
30
+ * {@inheritdoc}
31
+ */
32
+ avg(key?: string): number;
33
+ /**
34
+ * {@inheritdoc}
35
+ */
36
+ average(key?: string): number;
37
+ /**
38
+ * {@inheritdoc}
39
+ */
40
+ merge(...arrays: any[][]): Arrayable<T>;
41
+ /**
42
+ * Merge all unique values from all of the given array with current
43
+ * array and return new one
44
+ *
45
+ * @param {...array} arrays
46
+ * @returns {Arrayable<T>}
47
+ */
48
+ mergeUnique(...arrays: any[][]): Arrayable<T>;
49
+ /**
50
+ * {@inheritdoc}
51
+ */
52
+ concat(...arrays: any[][]): Arrayable<T>;
53
+ /**
54
+ * Get the value of the given index
55
+ *
56
+ * @param {number} index
57
+ * @returns {Arrayable}
58
+ */
59
+ set(index: number, value: any): any;
60
+ /**
61
+ * Get the value of the given index
62
+ *
63
+ * @param {number} index
64
+ * @returns {*}
65
+ * @memberof Arr
66
+ */
67
+ get(index: number): any;
68
+ /**
69
+ * {@inheritdoc}
70
+ */
71
+ unique(key?: string): Arrayable<T>;
72
+ /**
73
+ * Toggle the given value using the given callback
74
+ *
75
+ *
76
+ * @param {any} value
77
+ * @param {boolean} toggleIn
78
+ * @param {Function} indexFilter
79
+ * @returns {Array}
80
+ */
81
+ toggle(value: any, toggleIn: boolean, indexFilter?: Function): Arrayable<T>;
82
+ /**
83
+ * {@inheritdoc}
84
+ */
85
+ shift(): any;
86
+ /**
87
+ * {@inheritdoc}
88
+ */
89
+ unshift(...items: any[]): Arrayable<T>;
90
+ /**
91
+ * {@inheritdoc}
92
+ */
93
+ push(...items: any[]): Arrayable<T>;
94
+ /**
95
+ * {@inheritdoc}
96
+ */
97
+ pushOnce(...items: any[]): Arrayable<T>;
98
+ /**
99
+ * {@inheritdoc}
100
+ */
101
+ pop(): any;
102
+ /**
103
+ * {@inheritdoc}
104
+ */
105
+ end(): any;
106
+ /**
107
+ * {@inheritdoc}
108
+ */
109
+ remove(value: any): Arrayable<T>;
110
+ /**
111
+ * {@inheritdoc}
112
+ */
113
+ removeAll(value: any): Arrayable<T>;
114
+ /**
115
+ * {@inheritdoc}
116
+ */
117
+ first(key?: Function): any;
118
+ /**
119
+ * {@inheritdoc}
120
+ */
121
+ includes(value: any): boolean;
122
+ /**
123
+ * {@inheritdoc}
124
+ */
125
+ toArray(): any[];
126
+ /**
127
+ * {@inheritdoc}
128
+ */
129
+ map<T>(callback: ArrayCallback<T>): Arrayable<T>;
130
+ /**
131
+ * {@inheritdoc}
132
+ */
133
+ forEach(callback: ArrayCallback<T>): void;
134
+ /**
135
+ * {@inheritdoc}
136
+ */
137
+ filter(callback: ArrayCallback<T>): Arrayable<T>;
138
+ /**
139
+ * {@inheritdoc}
140
+ */
141
+ sort(callback?: (a: number, b: number) => number): Arrayable<T>;
142
+ /**
143
+ * {@inheritdoc}
144
+ */
145
+ sortBy(valueOrFunction: string | Function): Arrayable<T>;
146
+ /**
147
+ * {@inheritdoc}
148
+ */
149
+ sortByDesc(key: string | Function): Arrayable<T>;
150
+ /**
151
+ * {@inheritdoc}
152
+ */
153
+ reduce(callback: Function, initialValue?: any): any;
154
+ /**
155
+ * {@inheritdoc}
156
+ */
157
+ chunk(size: number): Arrayable<T>;
158
+ /**
159
+ * {@inheritdoc}
160
+ */
161
+ clone(): Arrayable<T>;
162
+ /**
163
+ * {@inheritdoc}
164
+ */
165
+ reverse(): Arrayable<T>;
166
+ /**
167
+ * {@inheritdoc}
168
+ */
169
+ indexOf(value: any): number;
170
+ /**
171
+ * {@inheritdoc}
172
+ */
173
+ lastIndexOf(value: any): number;
174
+ /**
175
+ * {@inheritdoc}
176
+ */
177
+ isEmpty(): boolean;
178
+ /**
179
+ * {@inheritdoc}
180
+ */
181
+ isNotEmpty(): boolean;
182
+ /**
183
+ * {@inheritdoc}
184
+ */
185
+ random(): any;
186
+ /**
187
+ * {@inheritdoc}
188
+ */
189
+ replace(oldValue: any, newValue: any): Arrayable<T>;
190
+ /**
191
+ * {@inheritdoc}
192
+ */
193
+ replaceAll(oldValue: any, newValue: any): Arrayable<T>;
194
+ /**
195
+ * {@inheritdoc}
196
+ */
197
+ shuffle(): Arrayable<T>;
198
+ /**
199
+ * {@inheritdoc}
200
+ */
201
+ slice(begin?: number | undefined, end?: number | undefined): Arrayable<T>;
202
+ /**
203
+ * {@inheritdoc}
204
+ */
205
+ splice(start: number, deleteCount: number, ...items: T[]): any;
206
+ /**
207
+ * {@inheritdoc}
208
+ */
209
+ some(callback: (value: T, index: number, array: T[]) => unknown): boolean;
210
+ /**
211
+ * {@inheritdoc}
212
+ */
213
+ every(callback: (value: T, index: number, array: T[]) => unknown): boolean;
214
+ /**
215
+ * {@inheritdoc}
216
+ */
217
+ unset(...keys: number[]): void;
218
+ /**
219
+ * {@inheritdoc}
220
+ */
221
+ off(event: string | string[]): void;
222
+ /**
223
+ * {@inheritdoc}
224
+ */
225
+ pluck(key: string): Arrayable<T>;
226
+ /**
227
+ * {@inheritdoc}
228
+ */
229
+ where(key: string, operator?: any, value?: any): Arrayable<T>;
230
+ /**
231
+ * {@inheritdoc}
232
+ */
233
+ firstWhere(key: any, operator: any, value?: any): any;
234
+ /**
235
+ * {@inheritdoc}
236
+ */
237
+ get length(): number;
238
+ /**
239
+ * Get last value based on given function callback
240
+ */
241
+ last(fn: any, defaultValue: any): any;
242
+ /**
243
+ * {@inheritdoc}
244
+ */
245
+ on(event: string | string[], callback: Function): void;
246
+ /**
247
+ * {@inheritdoc}
248
+ */
249
+ once(event: string | string[], callback: Function): void;
250
+ /**
251
+ * {@inheritdoc}
252
+ */
253
+ subscribe(event: string | string[], callback: Function): void;
254
+ /**
255
+ * {@inheritdoc}
256
+ */
257
+ trigger(event: string | string[], ...values: any[]): void;
258
+ /**
259
+ * {@inheritdoc}
260
+ */
261
+ emit(event: string | string[], ...values: any[]): void;
262
+ /**
263
+ * {@inheritdoc}
264
+ */
265
+ [Symbol.iterator](): Iterator<ArrayType>;
266
+ }
267
+ export {};
268
+ //# sourceMappingURL=arr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arr.d.ts","sourceRoot":"","sources":["../../../../../sources/@mongez/reinforcements/1.0.1/arr.ts"],"names":[],"mappings":"AACA,OAAO,SAAS,MAAM,uBAAuB,CAAC;AAE9C,OAAO,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,GAAG,CAAC;AACxD,OAAO,MAAM,aAAa,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,GAAG,CAAC;AAY7E,MAAM,CAAC,OAAO,OAAO,GAAG,CAAC,CAAC,CAAE,YAAW,SAAS,CAAC,CAAC,CAAC;IACjD;;;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,0 +1 @@
1
+ "use strict";var t=require("./node_modules/tslib/tslib.es6.js"),e=require("./obj.js");function r(t,e){return Object.is(t,e)}var n=function(){function n(t){void 0===t&&(t=[]),this.counter=0,this.items=[],this.items=t}return n.prototype.min=function(t){if(!t)return Math.min.apply(Math,this.items);for(var r=Number.MIN_VALUE,n=0,o=this.items;n<o.length;n++){var i=o[n];if(null===i||"object"!=typeof i){var s=Number(e.get(i,t));isNaN(s)||(s=Number(s))<r&&(r=s)}}return r},n.prototype.max=function(t){if(!t)return Math.max.apply(Math,this.items);for(var r=Number.MAX_VALUE,n=0,o=this.items;n<o.length;n++){var i=o[n];if(null===i||"object"!=typeof i){var s=Number(e.get(i,t));isNaN(s)||s>r&&(r=s)}}return r},n.prototype.avg=function(t){return this.items.reduce((function(r,n){return r+(t?e.get(n,t):n)}),Number.MIN_VALUE)/this.items.length},n.prototype.average=function(t){return this.avg(t)},n.prototype.merge=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return new n((t=this.items).concat.apply(t,e))},n.prototype.mergeUnique=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.merge.apply(this,t).unique()},n.prototype.concat=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return this.merge.apply(this,t)},n.prototype.set=function(t,e){return this.items[t]=e,this},n.prototype.get=function(t){return this.items[t]},n.prototype.unique=function(t){for(var r=new n,o=0,i=this.items;o<i.length;o++){var s=i[o];r.pushOnce(t?e.get(s,t):s)}return r},n.prototype.toggle=function(t,e,n){void 0===n&&(n=r);var o=this.items;if(!0===e){if(o.includes(t))return this;o.push(t)}else{var i=o.findIndex((function(e){return n(e,t)}));o.splice(i,1)}return this},n.prototype.shift=function(){return this.items.shift()},n.prototype.unshift=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return(t=this.items).unshift.apply(t,e),this},n.prototype.push=function(){for(var t,e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return(t=this.items).push.apply(t,e),this},n.prototype.pushOnce=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,n=t;r<n.length;r++){var o=n[r];this.items.includes(o)||this.items.push(o)}return this},n.prototype.pop=function(){return this.items.pop()},n.prototype.end=function(){return this.items[this.length-1]},n.prototype.remove=function(t){var e=!1;return this.items=this.items.filter((function(r){return!!e||(r!=t||(e=!0,!1))})),this},n.prototype.removeAll=function(t){return this.items=this.items.filter((function(e){return e!=t})),this},n.prototype.first=function(t){if(void 0===t)return this.items[0];for(var e=t,r=0;r<this.length;r++){var n=this.items[r];if(!0===e(n,r))return n}return null},n.prototype.includes=function(t){return this.items.includes(t)},n.prototype.toArray=function(){return this.items},n.prototype.map=function(t){return new n(this.items.map(t))},n.prototype.forEach=function(t){this.items.forEach(t)},n.prototype.filter=function(t){return new n(this.items.filter(t))},n.prototype.sort=function(t){return new n(this.items.sort(t))},n.prototype.sortBy=function(t){var r=this.items.concat([]),o="function"==typeof t,i=function(r){return o?t(r):e.get(r,t)};return r.sort((function(t,e){var r=i(t),n=i(e);return null==r?1:null==n||r<n?-1:r>n?1:0})),new n(r)},n.prototype.sortByDesc=function(t){return this.sortBy(t).reverse()},n.prototype.reduce=function(t,e){return this.items.forEach((function(r){e=t(e,r)})),e},n.prototype.chunk=function(t){var e=[],r=0;do{var o=new n(this.items.slice(r,r+t));e.push(o),r+=t}while(r<this.items.length);return new n(e)},n.prototype.clone=function(){return new n(Array.from(this.items))},n.prototype.reverse=function(){return new n(this.items.reverse())},n.prototype.indexOf=function(t){return this.items.indexOf(t)},n.prototype.lastIndexOf=function(t){return this.items.lastIndexOf(t)},n.prototype.isEmpty=function(){return 0===this.length},n.prototype.isNotEmpty=function(){return!1===this.isEmpty()},n.prototype.random=function(){return this.shuffle().first()},n.prototype.replace=function(t,e){for(var r=0;r<this.length;r++){if(this.get(r)==t){this.set(r,e);break}}return this},n.prototype.replaceAll=function(t,e){for(var r=0;r<this.length;r++){this.get(r)==t&&this.set(r,e)}return this},n.prototype.shuffle=function(){var t,e,r,n=this.clone();for(r=n.length;r;r-=1)t=Math.floor(Math.random()*r),e=n.get(r-1),n.set(r-1,n.get(t)),n.set(t,e);return n},n.prototype.slice=function(t,e){return new n(this.items.slice(t,e))},n.prototype.splice=function(e,r){for(var n,o=[],i=2;i<arguments.length;i++)o[i-2]=arguments[i];var s=(n=this.items).splice.apply(n,t.__spreadArray([e,r],o,!1));return s},n.prototype.some=function(t){return this.items.some(t)},n.prototype.every=function(t){return this.items.every(t)},n.prototype.unset=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,n=t;r<n.length;r++){var o=n[r];this.items.splice(o,1)}},n.prototype.off=function(t){throw new Error("Method not implemented.")},n.prototype.pluck=function(t){for(var r=new n,o=0,i=this.items;o<i.length;o++){var s=i[o];r.pushOnce(e.get(s,t))}return r},n.prototype.where=function(t,r,o){void 0===r&&(r=null),void 0===o&&(o=null);var i,s,u=r,p=o,h=(i=this.items,(s=[]).push.apply(s,i),s);return void 0===r||!0===r?new n(h.filter((function(r){return e.get(r,t)}))):!1===r?new n(h.filter((function(r){return!e.get(r,t)}))):(null===o&&(p=r,u="==="),new n(h.filter((function(r){switch(u){case"==":return e.get(r,t)===Number(p)||e.get(r,t)===p.toString();default:case"===":return e.get(r,t)===p;case"!=":case"<>":return e.get(r,t)!==Number(p)&&e.get(r,t)!==p.toString();case"!==":return e.get(r,t)!==p;case"<":return e.get(r,t)<p;case"<=":return e.get(r,t)<=p;case">":return e.get(r,t)>p;case">=":return e.get(r,t)>=p}}))))},n.prototype.firstWhere=function(t,e,r){return this.where(t,e,r).first()||null},Object.defineProperty(n.prototype,"length",{get:function(){return this.items.length},enumerable:!1,configurable:!0}),n.prototype.last=function(t,e){var r=this.clone(),n="function"==typeof t;return n&&(r=r.filter(t)),r.isEmpty()&&n?e():r.end()},n.prototype.on=function(t,e){throw new Error("Method not implemented.")},n.prototype.once=function(t,e){throw new Error("Method not implemented.")},n.prototype.subscribe=function(t,e){throw new Error("Method not implemented.")},n.prototype.trigger=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];throw new Error("Method not implemented.")},n.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];throw new Error("Method not implemented.")},n.prototype[Symbol.iterator]=function(){var t=this;return this.counter=0,{next:function(){return{done:t.length==t.counter,value:t.items[t.counter++]}}}},n}();module.exports=n;
@@ -0,0 +1,337 @@
1
+ import Iterable from "./iterable";
2
+ export default interface Arrayable<T> extends Iterable<any> {
3
+ /**
4
+ * Array length
5
+ *
6
+ * @type {number}
7
+ */
8
+ length: number;
9
+ /**
10
+ * Get min value of the array
11
+ *
12
+ * @returns {number}
13
+ */
14
+ min(): number;
15
+ /**
16
+ * Get max value of the array
17
+ *
18
+ * @returns {number}
19
+ */
20
+ max(): number;
21
+ /**
22
+ * Get the average value of the array
23
+ *
24
+ * @returns {number}
25
+ */
26
+ avg(): number;
27
+ /**
28
+ * Get the average value of the array
29
+ *
30
+ * @returns {number}
31
+ */
32
+ average(): number;
33
+ /**
34
+ * Merge the given arrays to the current one
35
+ *
36
+ * @param {...any[]} arrays
37
+ * @returns {Arrayable} new instance
38
+ */
39
+ merge(...arrays: Array<any>[]): Arrayable<T>;
40
+ /**
41
+ * Merge the given arrays to the current one
42
+ *
43
+ * @param {...any[]} arrays
44
+ * @returns {Arrayable} new instance
45
+ */
46
+ concat(...arrays: Array<any>[]): Arrayable<T>;
47
+ /**
48
+ * Get a unique array of values
49
+ *
50
+ * @returns {Arrayable} new instance
51
+ */
52
+ unique(): Arrayable<T>;
53
+ /**
54
+ * Shift the first item from the array
55
+ *
56
+ * @returns {any}
57
+ */
58
+ shift(): any;
59
+ /**
60
+ * Get first value based on given filtration options
61
+ *
62
+ * @param string key
63
+ * @param string operator
64
+ * @param any value
65
+ * @returns {*}
66
+ */
67
+ firstWhere(key: any, operator: any, value: any): any;
68
+ /**
69
+ * Unshift the given items to the beginning of the array
70
+ *
71
+ * @returns {any}
72
+ */
73
+ unshift(...items: any[]): any;
74
+ /**
75
+ * Push one or more values to the array
76
+ *
77
+ * @param {...any[]} items
78
+ * @returns {Arrayable}
79
+ */
80
+ push(...items: any[]): Arrayable<T>;
81
+ /**
82
+ * Push one or more values to the array if and
83
+ * only if the value doesn't exists in the array
84
+ *
85
+ * @param {...any[]} items
86
+ * @returns {Arrayable}
87
+ */
88
+ pushOnce(...items: any[]): Arrayable<T>;
89
+ /**
90
+ * Remove and get the last value of the array
91
+ *
92
+ * @returns {*}
93
+ */
94
+ pop(): any;
95
+ /**
96
+ * Get the last value of the array
97
+ *
98
+ * @returns {*}
99
+ */
100
+ end(): any;
101
+ /**
102
+ * Remove the first matched value with the given from the array
103
+ * then reorder the array
104
+ *
105
+ * @param {(Function|any)} value
106
+ * @returns {Arrayable}
107
+ */
108
+ remove(value: Function | any): Arrayable<T>;
109
+ /**
110
+ * Remove all matched values with the given value from the array
111
+ * then reorder the array
112
+ *
113
+ * @param {(Function|any)} value
114
+ * @returns {Arrayable}
115
+ */
116
+ removeAll(value: Function | any): Arrayable<T>;
117
+ /**
118
+ * Get the first value for the given callback function
119
+ * If no passed callback, return the first value
120
+ *
121
+ * @param {Function} [callback]
122
+ * @returns {*}
123
+ */
124
+ first(callback?: Function): any;
125
+ /**
126
+ * Determine if the array includes the given value
127
+ *
128
+ * @param {*} value
129
+ * @returns {boolean}
130
+ */
131
+ includes(value: any): boolean;
132
+ /**
133
+ * Get the value of the given index
134
+ *
135
+ * @param {number} index
136
+ * @returns {Arrayable}
137
+ */
138
+ set(index: number, value: any): any;
139
+ /**
140
+ * Get the value of the given index
141
+ *
142
+ * @param {number} index
143
+ * @returns {*}
144
+ * @memberof Arr
145
+ */
146
+ get(index: number): any;
147
+ /**
148
+ * Return an array containing all items
149
+ *
150
+ * @returns {Array<any>}
151
+ */
152
+ toArray(): Array<any>;
153
+ /**
154
+ * Map through the items using the given callback
155
+ *
156
+ * @param {Function} callback
157
+ * @returns {Arrayable} new instance
158
+ */
159
+ map(callback: Function): Arrayable<T>;
160
+ /**
161
+ * Walk through each element of the array and execute the given callback on it
162
+ *
163
+ * @param {Function} callback
164
+ */
165
+ forEach(callback: Function): void;
166
+ /**
167
+ * Filter the array using the given callback
168
+ *
169
+ * @param {Function} callback
170
+ * @returns {Arrayable} new instance
171
+ */
172
+ filter(callback: Function): Arrayable<T>;
173
+ /**
174
+ * Sort the array by the given callback, if no passed callback, use default sorting
175
+ *
176
+ * @param {Function} [callback]
177
+ * @returns {Arrayable}
178
+ */
179
+ sort(callback?: Function): Arrayable<T>;
180
+ /**
181
+ * Sort the array by the given key in ascendant order, this works only with arrays of objects
182
+ *
183
+ * @param {string} key
184
+ * @returns {Arrayable}
185
+ */
186
+ sortBy(key: string): Arrayable<T>;
187
+ /**
188
+ * Sort the array by the given key in descendant order, this works only with arrays of objects
189
+ *
190
+ * @param {string} key
191
+ * @returns {Arrayable}
192
+ */
193
+ sortByDesc(key: string): Arrayable<T>;
194
+ /**
195
+ * Execute a reducer function (that you provide) on each element of the array, resulting in a single output value.
196
+ *
197
+ * @param {Function} callback
198
+ * @param {*} initialValue
199
+ * @returns {*}
200
+ */
201
+ reduce(callback: Function, initialValue: any): any;
202
+ /**
203
+ * Chunk the array into groups of arrays based on the given size
204
+ *
205
+ * @param {number} size
206
+ * @returns {Arrayable} new instance
207
+ */
208
+ chunk(size: number): Arrayable<T>;
209
+ /**
210
+ * Clone the array into another new Arrayable instance
211
+ *
212
+ * @returns {Arrayable} new instance
213
+ */
214
+ clone(): Arrayable<T>;
215
+ /**
216
+ * Reverse the order of the array
217
+ *
218
+ * @returns {Arrayable} new instance
219
+ */
220
+ reverse(): Arrayable<T>;
221
+ /**
222
+ * Get the first index of the given value
223
+ *
224
+ * @param {*} value
225
+ * @returns {number}
226
+ */
227
+ indexOf(value: any): number;
228
+ /**
229
+ * Get the last index of the given value
230
+ *
231
+ * @param {*} value
232
+ * @returns {number}
233
+ */
234
+ lastIndexOf(value: any): number;
235
+ /**
236
+ * Determine if the array is empty
237
+ *
238
+ * @returns {boolean}
239
+ */
240
+ isEmpty(): boolean;
241
+ /**
242
+ * Determine if the array is not empty
243
+ *
244
+ * @returns {boolean}
245
+ */
246
+ isNotEmpty(): boolean;
247
+ /**
248
+ * Get random value from the array
249
+ *
250
+ * @returns {*}
251
+ */
252
+ random(): any;
253
+ /**
254
+ * Replace the first matched value with the given value from the array to the new value
255
+ *
256
+ * @param {*} oldValue
257
+ * @param {*} newValue
258
+ * @returns {Arrayable}
259
+ */
260
+ replace(oldValue: any, newValue: any): Arrayable<T>;
261
+ /**
262
+ * Replace all matched values with the given value from the array to the new value
263
+ *
264
+ * @param {*} oldValue
265
+ * @param {*} newValue
266
+ * @returns {Arrayable}
267
+ */
268
+ replaceAll(oldValue: any, newValue: any): Arrayable<T>;
269
+ /**
270
+ * Shuffle array items
271
+ *
272
+ * @returns {Arrayable}
273
+ */
274
+ shuffle(): Arrayable<T>;
275
+ /**
276
+ * Slice the array based on the given beginning and end value
277
+ *
278
+ * @param {number} [begin]
279
+ * @param {number} [end]
280
+ * @returns {Arrayable} new instance
281
+ */
282
+ slice(begin?: number, end?: number): Arrayable<T>;
283
+ /**
284
+ * Slice the array based on the given beginning and end value
285
+ *
286
+ * @param {number} start
287
+ * @param {number} [deleteCount]
288
+ * @param {...any[]} items
289
+ * @returns {Arrayable}
290
+ */
291
+ splice(start: number, deleteCount?: number, ...items: any[]): Arrayable<T>;
292
+ /**
293
+ * Tests whether at least one element in the array passes the test implemented by the provided function. It returns a Boolean value.
294
+ *
295
+ * @param {Function} callback
296
+ * @returns {boolean}
297
+ */
298
+ some(callback: Function): boolean;
299
+ /**
300
+ * Tests whether all elements in the array pass the test implemented by the provided function. It returns a Boolean value
301
+ *
302
+ * @param {Function} callback
303
+ * @returns {boolean}
304
+ */
305
+ every(callback: Function): boolean;
306
+ /**
307
+ * Remove all values from the array for the given keys
308
+ * then reorder the array
309
+ *
310
+ * @param {...number[]} keys
311
+ * @returns {any}
312
+ */
313
+ unset(...keys: number[]): any;
314
+ /**
315
+ * Pluck a column of value form array of objects
316
+ * The key should implement dot notation syntax.
317
+ *
318
+ * @param {string} key
319
+ * @returns {Arrayable}
320
+ */
321
+ pluck(key: string): Arrayable<T>;
322
+ /**
323
+ * Filter the items using the given criteria
324
+ * The key should implement dot notation syntax.
325
+ * This method accepts two or three arguments
326
+ * If two arguments passed, then the operator parameter will be the value parameter and the operator will be equal
327
+ *
328
+ * Available operators: `=`, `>`, `>=`, `<>`, `!=`, `<`, `<=`
329
+ *
330
+ * @param {string} key
331
+ * @param {any} operator
332
+ * @param {any} value
333
+ * @returns {Arrayable}
334
+ */
335
+ where(key: string, operator: any, value: any): Arrayable<T>;
336
+ }
337
+ //# sourceMappingURL=arrayable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arrayable.d.ts","sourceRoot":"","sources":["../../../../../../sources/@mongez/reinforcements/1.0.1/contracts/arrayable.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,OAAO,WAAW,SAAS,CAAC,CAAC,CAAE,SAAQ,QAAQ,CAAC,GAAG,CAAC;IACvD;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,GAAG,IAAI,MAAM,CAAC;IACd;;;;OAIG;IACH,GAAG,IAAI,MAAM,CAAA;IACb;;;;OAIG;IACH,GAAG,IAAI,MAAM,CAAC;IACd;;;;OAIG;IACH,OAAO,IAAI,MAAM,CAAC;IAClB;;;;;OAKG;IACH,KAAK,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC7C;;;;;OAKG;IACH,MAAM,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC9C;;;;OAIG;IACH,MAAM,IAAI,SA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CAAC,CAAC,CAAC,CAAC;IACvD;;;;OAIG;IACH,OAAO,IAAI,SAAS,CAAC,CAAC,CAAC,CAAC;IACxB;;;;;;OAMG;IACH,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAClD;;;;;;;OAOG;IACH,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IAC3E;;;;;OAKG;IACH,IAAI,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IAClC;;;;;OAKG;IACH,KAAK,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC;IACnC;;;;;;OAMG;IACH,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE,GAAG,GAAG,CAAC;IAE9B;;;;;;OAMG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;IACjC;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;CAC/D"}
@@ -0,0 +1,9 @@
1
+ export default interface Iterable<T> {
2
+ /**
3
+ * Make the implemented class an iterable one that could be iterated over it.
4
+ *
5
+ * @returns {Array<any>}
6
+ */
7
+ [Symbol.iterator](): Iterator<T>;
8
+ }
9
+ //# sourceMappingURL=iterable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iterable.d.ts","sourceRoot":"","sources":["../../../../../../sources/@mongez/reinforcements/1.0.1/contracts/iterable.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC,CAAC;IAC/B;;;;OAIG;IACH,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,CAAC;CACpC"}
package/cjs/index.d.ts ADDED
@@ -0,0 +1,24 @@
1
+ export { default as Arr } from "./arr";
2
+ export { default as Obj } from "./obj";
3
+ export { default as Random } from "./utilities/random";
4
+ export { default as trim } from "./utilities/str/trim";
5
+ export { default as ltrim } from "./utilities/str/ltrim";
6
+ export { default as rtrim } from "./utilities/str/rtrim";
7
+ export { default as ucfirst } from "./utilities/str/ucfirst";
8
+ export { default as escapeRegex } from "./utilities/escapeRegex";
9
+ export { default as extension } from "./utilities/str/extension";
10
+ export { default as repeatsOf } from "./utilities/str/repeatsOf";
11
+ export { default as removeLast } from "./utilities/str/removeLast";
12
+ export { default as capitalize } from "./utilities/str/capitalize";
13
+ export { default as replaceAll } from "./utilities/str/replaceAll";
14
+ export { default as toCamelCase } from "./utilities/str/toCamelCase";
15
+ export { default as toInputName } from "./utilities/str/toInputName";
16
+ export { default as toSnakeCase } from "./utilities/str/toSnakeCase";
17
+ export { default as replaceLast } from "./utilities/str/replaceLast";
18
+ export { default as removeFirst } from "./utilities/str/removeFirst";
19
+ export { default as replaceFirst } from "./utilities/str/replaceFirst";
20
+ export { default as toStudlyCase } from "./utilities/str/toStudlyCase";
21
+ export { default as sprintf, vsprintf } from "./utilities/str/sprintf";
22
+ export { default as readMoreWords } from "./utilities/str/readMoreWords";
23
+ export { default as readMoreChars } from "./utilities/str/readMoreChars";
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../sources/@mongez/reinforcements/1.0.1/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,OA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BAA+B,CAAC"}
package/cjs/index.js ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("./arr.js"),r=require("./obj.js"),t=require("./utilities/random.js"),s=require("./utilities/str/trim.js"),i=require("./utilities/str/ltrim.js"),u=require("./utilities/str/rtrim.js"),o=require("./utilities/str/ucfirst.js"),p=require("./utilities/escapeRegex.js"),a=require("./utilities/str/extension.js"),l=require("./utilities/str/repeatsOf.js"),x=require("./utilities/str/removeLast.js"),j=require("./utilities/str/capitalize.js"),q=require("./utilities/str/replaceAll.js"),m=require("./utilities/str/toCamelCase.js"),n=require("./utilities/str/toInputName.js"),c=require("./utilities/str/toSnakeCase.js"),d=require("./utilities/str/replaceLast.js"),f=require("./utilities/str/removeFirst.js"),C=require("./utilities/str/replaceFirst.js"),v=require("./utilities/str/toStudlyCase.js"),M=require("./utilities/str/sprintf.js"),F=require("./utilities/str/readMoreWords.js"),L=require("./utilities/str/readMoreChars.js");exports.Arr=e,exports.Obj=r,exports.Random=t,exports.trim=s,exports.ltrim=i,exports.rtrim=u,exports.ucfirst=o,exports.escapeRegex=p,exports.extension=a,exports.repeatsOf=l,exports.removeLast=x,exports.capitalize=j,exports.replaceAll=q,exports.toCamelCase=m,exports.toInputName=n,exports.toSnakeCase=c,exports.replaceLast=d,exports.removeFirst=f,exports.replaceFirst=C,exports.toStudlyCase=v,exports.sprintf=M.default,exports.vsprintf=M.vsprintf,exports.readMoreWords=F,exports.readMoreChars=L;