Skip to content

Commit 37905b0

Browse files
authored
Merge pull request #22 from hckrnews/feature/finetune-docblocks
Finetune docblocks
2 parents 7dd47a1 + b651694 commit 37905b0

File tree

3 files changed

+37
-29
lines changed

3 files changed

+37
-29
lines changed

package-lock.json

+6-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hckrnews/arrays",
3-
"version": "3.0.4",
3+
"version": "3.0.5",
44
"description": "Usefull array helpers.",
55
"files": [
66
"src/helpers.js",
@@ -66,5 +66,9 @@
6666
"type": "module",
6767
"engines": {
6868
"node": ">= 18"
69+
},
70+
"funding": {
71+
"type": "github",
72+
"url": "https://github.com/sponsors/w3nl"
6973
}
7074
}

src/helpers.js

+26-26
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class Arr extends Array {
2828
* @param {string} key
2929
* @param {string=} direction
3030
*
31-
* @return {array}
31+
* @return {any[]}
3232
*/
3333
multisort(key, direction) {
3434
return multisort(this[0], key, direction);
@@ -41,7 +41,7 @@ class Arr extends Array {
4141
* @param {string} find
4242
* @param {boolean=} operator
4343
*
44-
* @return {array}
44+
* @return {any[]}
4545
*/
4646
multifilter(key, find, operator) {
4747
return multifilter(this[0], key, find, operator);
@@ -52,7 +52,7 @@ class Arr extends Array {
5252
*
5353
* @param {string} key
5454
*
55-
* @return {array}
55+
* @return {any[]}
5656
*/
5757
multikey(key) {
5858
return multikey(this[0], key);
@@ -61,10 +61,10 @@ class Arr extends Array {
6161
/**
6262
* Get the intersection of arrays.
6363
*
64-
* @param {string} array
64+
* @param {any[]} array
6565
* @param {boolean=} multi
6666
*
67-
* @return {array}
67+
* @return {any[]}
6868
*/
6969
intersect(array, multi) {
7070
return intersect(this[0], array, multi);
@@ -73,10 +73,10 @@ class Arr extends Array {
7373
/**
7474
* Get the difference of arrays.
7575
*
76-
* @param {string} array
76+
* @param {any[]} array
7777
* @param {boolean=} total
7878
*
79-
* @return {array}
79+
* @return {any[]}
8080
*/
8181
diff(array, total) {
8282
return diff(this[0], array, total);
@@ -85,7 +85,7 @@ class Arr extends Array {
8585
/**
8686
* Get the unique values of an array.
8787
*
88-
* @return {array}
88+
* @return {any[]}
8989
*/
9090
get unique() {
9191
return unique(this[0]);
@@ -94,9 +94,9 @@ class Arr extends Array {
9494
/**
9595
* Only add the value if the value isnt in the array.
9696
*
97-
* @param {string} newValue
97+
* @param {any} newValue
9898
*
99-
* @return {int}
99+
* @return {number}
100100
*/
101101
pushIfNotExists(newValue) {
102102
if (this.indexOf(newValue) < 0) {
@@ -109,9 +109,9 @@ class Arr extends Array {
109109
/**
110110
* Add multiple values to an array.
111111
*
112-
* @param {array} newValues
112+
* @param {any[]} newValues
113113
*
114-
* @return {int}
114+
* @return {number}
115115
*/
116116
pushMultiple(newValues) {
117117
this.push(...newValues);
@@ -123,9 +123,9 @@ class Arr extends Array {
123123
* Add multiple values to an array.
124124
* Only add the value if the value isnt in the array.
125125
*
126-
* @param {array} newValues
126+
* @param {any[]} newValues
127127
*
128-
* @return {int}
128+
* @return {number}
129129
*/
130130
pushMultipleIfNotExists(newValues) {
131131
const array = this;
@@ -142,7 +142,7 @@ class Arr extends Array {
142142
* If at least one of the arguments cannot be converted to a number,
143143
* NaN is returned.
144144
*
145-
* @return {int}
145+
* @return {number}
146146
*/
147147
get max() {
148148
return max(this[0]);
@@ -153,7 +153,7 @@ class Arr extends Array {
153153
* If at least one of the arguments cannot be converted to a number,
154154
* NaN is returned.
155155
*
156-
* @return {int}
156+
* @return {number}
157157
*/
158158
get min() {
159159
return min(this[0]);
@@ -162,7 +162,7 @@ class Arr extends Array {
162162
/**
163163
* Get a random value of an array.
164164
*
165-
* @return {string}
165+
* @return {any}
166166
*/
167167
get random() {
168168
return random(this);
@@ -171,7 +171,7 @@ class Arr extends Array {
171171
/**
172172
* The summ of all values.
173173
*
174-
* @return {int}
174+
* @return {number}
175175
*/
176176
get summ() {
177177
return summ(this[0]);
@@ -180,7 +180,7 @@ class Arr extends Array {
180180
/**
181181
* Get the average of all values.
182182
*
183-
* @return {int}
183+
* @return {number}
184184
*/
185185
get average() {
186186
return average(this[0]);
@@ -190,9 +190,9 @@ class Arr extends Array {
190190
* Javascript implementation of Arr::get
191191
*
192192
* @param {string} key
193-
* @param {object|null} defaultValue
193+
* @param {object=} defaultValue
194194
*
195-
* @return {object|null}
195+
* @return {any|undefined}
196196
*/
197197
getByKey(key, defaultValue) {
198198
return getByKey(this[0], key, defaultValue);
@@ -201,7 +201,7 @@ class Arr extends Array {
201201
/**
202202
* Javascript implementation of Arr::first
203203
*
204-
* @return {object|null}
204+
* @return {any|undefined}
205205
*/
206206
get first() {
207207
return first(this[0]);
@@ -210,7 +210,7 @@ class Arr extends Array {
210210
/**
211211
* Javascript implementation of Arr::last
212212
*
213-
* @return {object|null}
213+
* @return {any|undefined}
214214
*/
215215
get last() {
216216
return last(this[0]);
@@ -219,10 +219,10 @@ class Arr extends Array {
219219
/**
220220
* Update multiple items in an array
221221
*
222-
* @param {array} newValues
223-
* @param {array} keys
222+
* @param {any[]} newValues
223+
* @param {string[]} keys
224224
*
225-
* @return {array}
225+
* @return {any[]}
226226
*/
227227
update(newValues, keys) {
228228
return update(this[0], newValues, keys);

0 commit comments

Comments
 (0)