@janekolszak/poland 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/map.ts CHANGED
@@ -56,6 +56,18 @@ export class MultiKeyMap {
56
56
  }
57
57
  }
58
58
 
59
+ Get2Deep(): NamesMapTwoKeys {
60
+ var out: NamesMapTwoKeys = {}
61
+ this.forEach((keys, value) => {
62
+ const [v, c] = keys
63
+ if (!out[v]) {
64
+ out[v] = {}
65
+ }
66
+ out[v][c] = value
67
+ })
68
+ return out
69
+ }
70
+
59
71
  Get3Deep(): NamesMapThreeKeys {
60
72
  var out: NamesMapThreeKeys = {}
61
73
  this.forEach((keys, value) => {
@@ -66,10 +78,7 @@ export class MultiKeyMap {
66
78
  if (!out[v][c]) {
67
79
  out[v][c] = {}
68
80
  }
69
- if (!out[v][c][m]) {
70
- out[v][c][m] = []
71
- }
72
- out[v][c][m].push(value)
81
+ out[v][c][m] = value
73
82
  })
74
83
  return out
75
84
  }
@@ -87,10 +96,7 @@ export class MultiKeyMap {
87
96
  if (!out[v][c][m]) {
88
97
  out[v][c][m] = {}
89
98
  }
90
- if (!out[v][c][m][l]) {
91
- out[v][c][m][l] = []
92
- }
93
- out[v][c][m][l].push(value)
99
+ out[v][c][m][l] = value
94
100
  })
95
101
  return out
96
102
  }