From 7580836815abf24c81b29009f46878adba76ace3 Mon Sep 17 00:00:00 2001 From: Ruidy Date: Fri, 14 Nov 2025 13:36:51 +0100 Subject: [PATCH] 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. --- README.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 77e0b30..8159a75 100644 --- a/README.md +++ b/README.md @@ -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