2.2.11 • Published 3 years ago

@extra-set/partition-as.min v2.2.11

Weekly downloads
24
License
MIT
Repository
github
Last release
3 years ago

Segregates values by similarity. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: partition, partitionAs.

This is part of package extra-set.

This is browserified, minified version of @extra-set/partition-as. It is exported as global variable set_partitionAs. CDN: unpkg, jsDelivr.

set.partitionAs(x, fm);
// x:  a set
// fm: map function (v, v, x)
const set = require("extra-set");

var x = new Set([1, 2, 3, 4]);
set.partitionAs(x, v => v % 2 === 0);
// Map(2) { false => Set(2) { 1, 3 }, true => Set(2) { 2, 4 } }

var x = new Set([1, 2, 3, 4, 5]);
set.partitionAs(x, v => v % 3);
// Map(3) {
//   1 => Set(2) { 1, 4 },
//   2 => Set(2) { 2, 5 },
//   0 => Set(1) { 3 }
// }

References

2.2.11

3 years ago

2.2.10

3 years ago

2.2.9

3 years ago

2.2.8

3 years ago

2.2.7

3 years ago

2.2.5

3 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.1.63

4 years ago

2.1.61

4 years ago

2.1.62

4 years ago

2.1.60

4 years ago

2.1.58

4 years ago

2.1.59

4 years ago

2.1.56

4 years ago

2.1.57

4 years ago

2.1.55

4 years ago

2.1.54

4 years ago

2.1.52

4 years ago

2.1.53

4 years ago

2.1.49

4 years ago

2.1.47

4 years ago

2.1.48

4 years ago

2.1.50

4 years ago

2.1.51

4 years ago

2.1.45

4 years ago

2.1.46

4 years ago

2.1.44

4 years ago

2.1.43

4 years ago

2.1.42

4 years ago