@dra2020/baseclient 1.0.86 → 1.0.87

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.
@@ -16,6 +16,7 @@ export declare class MultiBlockMapping {
16
16
  add(tag: string, bm: BlockMapping): void;
17
17
  remove(tag: string): void;
18
18
  map(blockid: string): string;
19
+ mapmain(blockid: string): string;
19
20
  rev(geoid: string): string[];
20
21
  }
21
22
  export {};
@@ -48,7 +48,8 @@ export class MultiBlockMapping
48
48
 
49
49
  map(blockid: string): string
50
50
  {
51
- for (let i = 0; i < this.entries.length; i++)
51
+ // Walk backwards to pick up overrides first
52
+ for (let i = this.entries.length-1; i >= 0; i--)
52
53
  {
53
54
  let e = this.entries[i];
54
55
  if (e.bm[blockid])
@@ -57,6 +58,11 @@ export class MultiBlockMapping
57
58
  return undefined;
58
59
  }
59
60
 
61
+ mapmain(blockid: string): string
62
+ {
63
+ return this.entries.length ? this.entries[0].bm[blockid] : undefined;
64
+ }
65
+
60
66
  rev(geoid: string): string[]
61
67
  {
62
68
  for (let i = 0; i < this.entries.length; i++)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.86",
3
+ "version": "1.0.87",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",