docs(readme): update usage, API, and utilities sections

Update README to use the latest version in install instructions, expand
the
list of available API functions, and add documentation for new utilities
and
subpackages. Improves clarity and completeness for users.
This commit is contained in:
Ruidy 2025-11-14 13:36:51 +01:00
parent c53d46816f
commit 7580836815
No known key found for this signature in database
GPG key ID: 705C24D202990805

View file

@ -21,7 +21,7 @@ It is mostly a port from the `underscore.js` library based on generics brought b
Install the library using
```sh
go get github.com/rjNemo/underscore@0.7.0
go get github.com/rjNemo/underscore@latest
```
Please check out the [examples](examples) to see how to use the library.
@ -92,22 +92,32 @@ make test
- `All`
- `Any`
- `Chunk`
- `Contains`
- `ContainsBy`
- `Count`
- `Difference`
- `Drop`
- `Each`
- `Filter`
- `Find`
- `Flatmap`
- `GroupBy`
- `Find`
- `Intersection`
- `Join` / `JoinProject`
- `Last`
- `Map`
- `Max`
- `Min`
- `OrderBy`
- `Partition`
- `Range`
- `Reduce`
- `Sum` / `SumMap`
- `Unique`
- `UniqueBy`
- `UniqueInPlace`
- `Chunk`
- `Zip`
### Pipe
@ -157,9 +167,18 @@ func main() {
}
```
### Utilities
- `Ternary`: conditional expression helper
- `ToPointer`: convert values to pointers
- `SortSliceASC` / `SortSliceDESC`: sort slices in ascending or descending order
- `Result`, `Ok`, `Err`, `ToResult`: Result type for error handling
- `Tuple`: generic tuple type for paired values
### Subpackages
- `maps.Keys(m)` / `maps.Values(m)`: utilities to extract keys or values from maps.
- `maps.Keys(m)` / `maps.Values(m)`: extract keys or values from maps
- `maps.Map(m, fn)`: transform map entries
## Built With