bs-js-collections
Advanced tools
Comparing version 1.7.0 to 1.8.0
{ | ||
"name": "bs-js-collections", | ||
"description": "Bindings to JavaScript primitive Set and Map types", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"scripts": { | ||
@@ -6,0 +6,0 @@ "copy-git-hooks": "mkdir -p ./.git/hooks && cp -v ./hooks/* ./.git/hooks", |
# `bs-js-collections` | ||
Bindings to primitive JavaScript `Set` and `Map` types for BuckleScript/ReScript, plus | ||
some useful bells and whistles. | ||
Bindings to primitive JavaScript `Set` and `Map` types for | ||
BuckleScript/ReScript. | ||
In addition to bindings to the native API, this library adds a number | ||
of functions useful for pure functional programming, such as: | ||
* Conversion to/from various data structures such as arrays, lists, | ||
dicts and `Belt` data structures | ||
* `map`, `keep`, `reduce`, including `*WithKey` versions for the Map type | ||
* Set operations such as `union`, `intersection` and `diff` | ||
It is largely influenced by `Belt`, following similar naming | ||
conventions and favoring fast-pipe argument order | ||
(i.e. significant-data-first). | ||
## Examples | ||
@@ -26,4 +38,7 @@ | ||
// Filter the set | ||
let my | ||
Js.log(myIntSet->keep(i => i < 3)); // { 1, 2 } | ||
// Filter and map the set | ||
Js.log(myIntSet->keepMap(i => i == 2 ? None : Some(i->string_of_int))); // { '1', '3' } | ||
Js.log(myIntSet->JsSet.size); // 2 | ||
@@ -42,10 +57,2 @@ ``` | ||
In addition to bindings to the native API, this library adds a number | ||
of functions useful for pure functional programming, such as: | ||
* Conversion to/from various data structures such as arrays, lists, | ||
dicts and `Belt` data structures | ||
* `map`, `keep`, `reduce`, including `*WithKey` versions for the Map type | ||
* Set operations such as `union`, `intersection` and `diff` | ||
See the `.rei` files for more tails, and unit tests examples of usage. | ||
@@ -52,0 +59,0 @@ In general we try to follow naming conventions similar to `Belt` and |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29245
84