@stacksjs/collections 0.37.9 → 0.38.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.
- package/README.md +24 -12
- package/package.json +8 -7
package/README.md
CHANGED
|
@@ -1,32 +1,35 @@
|
|
|
1
1
|
# Stacks Collections
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Easily work with via Laravel-like collections.
|
|
4
4
|
|
|
5
5
|
## ☘️ Features
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- ⚡️
|
|
10
|
-
|
|
11
|
-
wip
|
|
7
|
+
- Access to Laravel-like Collections API
|
|
8
|
+
- Other object helpers
|
|
12
9
|
|
|
13
10
|
## 🤖 Usage
|
|
14
11
|
|
|
15
|
-
wip
|
|
16
|
-
|
|
17
12
|
```bash
|
|
18
13
|
pnpm i -D @stacksjs/collections
|
|
19
14
|
```
|
|
20
15
|
|
|
21
|
-
Now, you can
|
|
16
|
+
Now, you can easily access it in your project:
|
|
22
17
|
|
|
23
18
|
```js
|
|
24
19
|
import { collect } from '@stacksjs/collections'
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
const collection = collect([{
|
|
22
|
+
name: 'My story',
|
|
23
|
+
pages: 176,
|
|
24
|
+
}, {
|
|
25
|
+
name: 'Fantastic Beasts and Where to Find Them',
|
|
26
|
+
pages: 1096,
|
|
27
|
+
}])
|
|
28
|
+
|
|
29
|
+
console.log(collection.avg('pages')) // 636
|
|
27
30
|
```
|
|
28
31
|
|
|
29
|
-
|
|
32
|
+
To view the full documentation, please visit [https://stacksjs.dev/collections](https://stacksjs.dev/collections).
|
|
30
33
|
|
|
31
34
|
## 🧪 Testing
|
|
32
35
|
|
|
@@ -36,7 +39,7 @@ pnpm test
|
|
|
36
39
|
|
|
37
40
|
## 📈 Changelog
|
|
38
41
|
|
|
39
|
-
Please see our [releases](https://github.com/stacksjs/
|
|
42
|
+
Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
|
|
40
43
|
|
|
41
44
|
## 💪🏼 Contributing
|
|
42
45
|
|
|
@@ -52,6 +55,15 @@ For casual chit-chat with others using this package:
|
|
|
52
55
|
|
|
53
56
|
[Join the Open Web Discord Server](https://discord.ow3.org)
|
|
54
57
|
|
|
58
|
+
## 🙏🏼 Credits
|
|
59
|
+
|
|
60
|
+
Many thanks to the following core technologies & people who have contributed to this package:
|
|
61
|
+
|
|
62
|
+
- [Collect.js](https://github.com/ecrmnn/collect.js)
|
|
63
|
+
- [Laravel](https://laravel.com/)
|
|
64
|
+
- [Chris Breuer](https://github.com/chrisbbreuer)
|
|
65
|
+
- [All Contributors](../../contributors)
|
|
66
|
+
|
|
55
67
|
## 📄 License
|
|
56
68
|
|
|
57
69
|
The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/collections",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "0.38.2",
|
|
5
|
+
"packageManager": "pnpm@7.15.0",
|
|
6
6
|
"description": "The Stacks collections.",
|
|
7
7
|
"author": "Chris Breuer",
|
|
8
8
|
"license": "MIT",
|
|
@@ -32,17 +32,18 @@
|
|
|
32
32
|
"Chris Breuer <chris@ow3.org>"
|
|
33
33
|
],
|
|
34
34
|
"files": [
|
|
35
|
-
"dist"
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md"
|
|
36
37
|
],
|
|
37
38
|
"engines": {
|
|
38
|
-
"node": ">=v18.
|
|
39
|
-
"pnpm": ">=7.
|
|
39
|
+
"node": ">=v18.12.1",
|
|
40
|
+
"pnpm": ">=7.15.0"
|
|
40
41
|
},
|
|
41
|
-
"
|
|
42
|
+
"peerDependencies": {
|
|
42
43
|
"collect.js": "^4.34.3"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"mkdist": "^0.
|
|
46
|
+
"mkdist": "^0.4.0",
|
|
46
47
|
"typescript": "^4.8.4"
|
|
47
48
|
},
|
|
48
49
|
"scripts": {
|