2.2.11 • Published 3 years ago

@extra-set/flat-map v2.2.11

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

Flattens nested set, using map function. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: flat, flatMap.

This is part of package extra-set.

set.flatMap(x, [fm], [ft]);
// x:  a nested set
// fm: map function (v, v, x)
// ft: test function (v, v, x)
const set = require("extra-set");

var x = new Set([
  new Set([1, 2]),
  new Set([3, new Set([4, new Set([5])])])
]);
set.flatMap(x);
// Set(4) { 1, 2, 3, Set(2) { 4, Set(1) { 5 } } }

set.flatMap(x, v => set.flat(v, 1));
// Set(5) { 1, 2, 3, 4, Set(1) { 5 } }

set.flatMap(x, v => set.flat(v));
// Set(5) { 1, 2, 3, 4, 5 }

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.59

4 years ago

2.1.60

4 years ago

2.1.58

4 years ago

2.1.57

4 years ago

2.1.56

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.46

4 years ago

2.1.50

4 years ago

2.1.51

4 years ago

2.1.45

4 years ago

2.1.44

4 years ago

2.1.43

4 years ago

2.1.42

4 years ago