diff options
Diffstat (limited to 'src/util/wiki-data.js')
-rw-r--r-- | src/util/wiki-data.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/util/wiki-data.js b/src/util/wiki-data.js index 4855a7a2..f97ecd63 100644 --- a/src/util/wiki-data.js +++ b/src/util/wiki-data.js @@ -460,3 +460,16 @@ export class TupleMapForBabies { } } } + +const combinedWikiDataTupleMap = new TupleMapForBabies(); + +export function combineWikiDataArrays(arrays) { + const map = combinedWikiDataTupleMap; + if (map.has(...arrays)) { + return map.get(...arrays); + } else { + const combined = arrays.flat(); + map.set(...arrays, combined); + return combined; + } +} |