@stacksjs/collections 0.75.234 → 0.75.237

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.md ADDED
@@ -0,0 +1,21 @@
1
+ # MIT License
2
+
3
+ Copyright (c) 2023 Open Web Foundation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,71 @@
1
+ # Stacks Collections
2
+
3
+ Easily work with via Laravel-like collections.
4
+
5
+ ## ☘️ Features
6
+
7
+ - Access to Laravel-like Collections API
8
+ - Other object helpers
9
+
10
+ ## 🤖 Usage
11
+
12
+ ```bash
13
+ bun install -d @stacksjs/collections
14
+ ```
15
+
16
+ Now, you can easily access it in your project:
17
+
18
+ ```js
19
+ import { collect } from '@stacksjs/collections'
20
+
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
30
+ ```
31
+
32
+ To view the full documentation, please visit [<https://stacksjs.com/collection>s](https://stacksjs.com/collections).
33
+
34
+ ## 🧪 Testing
35
+
36
+ ```bash
37
+ bun test
38
+ ```
39
+
40
+ ## 📈 Changelog
41
+
42
+ Please see our [releases](https://github.com/stacksjs/stacks/releases) page for more information on what has changed recently.
43
+
44
+ ## 🚜 Contributing
45
+
46
+ Please review the [Contributing Guide](https://github.com/stacksjs/contributing) for details.
47
+
48
+ ## 🏝 Community
49
+
50
+ For help, discussion about best practices, or any other conversation that would benefit from being searchable:
51
+
52
+ [Discussions on GitHub](https://github.com/stacksjs/stacks/discussions)
53
+
54
+ For casual chit-chat with others using this package:
55
+
56
+ [Join the Stacks Discord Server](https://stacksjs.com/discord)
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
+
67
+ ## 📄 License
68
+
69
+ The MIT License (MIT). Please see [LICENSE](https://github.com/stacksjs/stacks/tree/main/LICENSE.md) for more information.
70
+
71
+ Made with 💙
@@ -0,0 +1,26 @@
1
+ /*
2
+ * The types, not just the function.
3
+ *
4
+ * `collect()` returns `CollectionOperations<T>`, and this package used to
5
+ * export no way to name it. A consumer that wanted to annotate a collection
6
+ * had to reach past this package into `ts-collect` itself, so in practice
7
+ * nobody did, and declarations fell back to whatever could be inferred.
8
+ *
9
+ * That is not free at a package boundary: `bun-plugin-dtsx` could not follow
10
+ * the inferred type out through this re-export and emitted
11
+ * `export declare const quotes: unknown` for `@stacksjs/cli`, which is what
12
+ * made a freshly scaffolded app fail its own `buddy typecheck`
13
+ * (stacksjs/stacks#2389).
14
+ */
15
+ export type {
16
+ Collection,
17
+ CollectionMetrics,
18
+ CollectionOperations,
19
+ LazyCollectionOperations,
20
+ PaginationResult,
21
+ StandardDeviationResult,
22
+ ValidationSchema,
23
+ } from 'ts-collect';
24
+ // Avoid ts-collect 0.4.1 and 0.4.2: their published dist is unparseable, so an
25
+ // import here took the whole test suite down. Fixed in 0.4.3.
26
+ export { collect } from 'ts-collect';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export{collect}from"ts-collect";
@@ -0,0 +1,5 @@
1
+ {
2
+ "compilerOptions": {
3
+ "paths": {}
4
+ }
5
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/collections",
3
3
  "type": "module",
4
- "version": "0.75.234",
4
+ "version": "0.75.237",
5
5
  "description": "The Stacks collections.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [