@dra2020/baseclient 1.0.144 → 1.0.146

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/lib/util/util.ts CHANGED
@@ -327,7 +327,7 @@ export function deepEqual(o1: any, o2: any, options?: EqOptions): boolean
327
327
  {
328
328
  if (options && options.omitKey && options.omitKey[p])
329
329
  continue;
330
- if (o2[p] === undefined)
330
+ if (o2[p] === undefined && o1[p] !== undefined)
331
331
  return false;
332
332
  if (! deepEqual(o1[p], o2[p], options))
333
333
  return false;
@@ -337,7 +337,7 @@ export function deepEqual(o1: any, o2: any, options?: EqOptions): boolean
337
337
  {
338
338
  if (options && options.omitKey && options.omitKey[p])
339
339
  continue;
340
- if (o1[p] === undefined)
340
+ if (o1[p] === undefined && o2[p] !== undefined)
341
341
  return false;
342
342
  }
343
343
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dra2020/baseclient",
3
- "version": "1.0.144",
3
+ "version": "1.0.146",
4
4
  "description": "Utility functions for Javascript projects.",
5
5
  "main": "dist/baseclient.js",
6
6
  "types": "./dist/all/all.d.ts",