@dra2020/baseclient 1.0.144 → 1.0.145

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.
@@ -22,5 +22,6 @@ export declare class MultiBlockMapping {
22
22
  mapmain(blockid: string): string;
23
23
  rev(geoid: string): string[];
24
24
  forEach(cb: (blockid: string) => void): void;
25
+ forEachRev(cb: (geoidid: string, blocks: string[]) => void): void;
25
26
  }
26
27
  export {};
@@ -101,4 +101,15 @@ export class MultiBlockMapping
101
101
  if (this.entries.length)
102
102
  Object.keys(this.entries[0].bm).forEach(blockid => cb(blockid));
103
103
  }
104
+
105
+ // Just walks first map
106
+ forEachRev(cb: (geoidid: string, blocks: string[]) => void): void
107
+ {
108
+ for (let i = 0; i < this.entries.length; i++)
109
+ {
110
+ let e = this.entries[i];
111
+ if (! e.rbm) e.rbm = reverseBlockMapping(e.bm);
112
+ Object.keys(e.rbm).forEach(geoid => cb(geoid, e.rbm[geoid]));
113
+ }
114
+ }
104
115
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.144",
3
+ "version": "1.0.145",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",