2.2.11 • Published 5 years ago

@extra-set/flat v2.2.11

Weekly downloads
22
License
MIT
Repository
github
Last release
5 years ago

Flattens nested set to given depth. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: flat, flatMap.

This is part of package extra-set.

set.flat(x, [n], [fm], [ft]);
// x:  a nested set
// n:  maximum depth (-1 => all)
// 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.flat(x);
// Set(5) { 1, 2, 3, 4, 5 }

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

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

References

2.2.11

5 years ago

2.2.10

5 years ago

2.2.9

5 years ago

2.2.8

5 years ago

2.2.7

5 years ago

2.2.5

5 years ago

2.2.4

5 years ago

2.2.3

6 years ago

2.2.2

6 years ago

2.2.1

6 years ago

2.2.0

6 years ago

2.1.63

6 years ago

2.1.61

6 years ago

2.1.62

6 years ago

2.1.58

6 years ago

2.1.59

6 years ago

2.1.60

6 years ago

2.1.57

6 years ago

2.1.56

6 years ago

2.1.55

6 years ago

2.1.54

6 years ago

2.1.52

6 years ago

2.1.53

6 years ago

2.1.50

6 years ago

2.1.51

6 years ago

2.1.49

6 years ago

2.1.47

6 years ago

2.1.48

6 years ago

2.1.46

6 years ago

2.1.45

6 years ago

2.1.44

6 years ago

2.1.43

6 years ago

2.1.42

6 years ago