@contrail/util 1.0.61 → 1.0.62

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.
@@ -6,7 +6,7 @@ import { applyChangesIfEqual, determineChangesIfEqual, areItemPropertyValuesEqua
6
6
  export { ObjectDiff } from './compareDeep/compareDeep';
7
7
  export declare class ObjectUtil {
8
8
  static getByPath(obj: any, path: string, def?: any): any;
9
- static getBySlugs(obj: any, rootSlug: string, slug: string): any;
9
+ static getBySlugs(obj: any, rootSlug: string, slug?: string): any;
10
10
  static setByPath(obj: any, path: string, value: any): void;
11
11
  static chunk(array: any[], size: number): any[];
12
12
  static isObject: typeof isObject;
@@ -21,7 +21,7 @@ class ObjectUtil {
21
21
  }
22
22
  static getBySlugs(obj, rootSlug, slug) {
23
23
  const rootValue = obj[rootSlug];
24
- if (rootValue) {
24
+ if (rootValue && slug) {
25
25
  return rootValue[slug];
26
26
  }
27
27
  return rootValue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/util",
3
- "version": "1.0.61",
3
+ "version": "1.0.62",
4
4
  "description": "General javascript utilities",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",