@contrail/util 1.1.18 → 1.2.0-alpha-otel-1

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.
@@ -1,5 +1,9 @@
1
1
  export declare function cloneDeep<T>(obj: T): DatesAsStrings<T> | null;
2
- type DatesAsStrings<T> = T extends Date ? string : T extends (infer U)[] ? DatesAsStrings<U>[] : T extends object ? {
2
+ export type IsTuple<T> = T extends readonly any[] ? (number extends T['length'] ? false : true) : false;
3
+ type MapTupleMutableDatesAsStrings<T extends any[]> = T extends [infer H, ...infer R] ? [DatesAsStrings<H>, ...MapTupleMutableDatesAsStrings<R>] : [];
4
+ type MapTupleReadonlyDatesAsStrings<T extends readonly any[]> = T extends readonly [infer H, ...infer R] ? readonly [DatesAsStrings<H>, ...MapTupleReadonlyDatesAsStrings<R>] : readonly [];
5
+ export type MapTupleDatesAsStrings<T extends readonly any[]> = T extends any[] ? MapTupleMutableDatesAsStrings<T> : MapTupleReadonlyDatesAsStrings<T>;
6
+ export type DatesAsStrings<T> = T extends Date ? string : T extends any[] ? IsTuple<T> extends true ? MapTupleDatesAsStrings<T> : DatesAsStrings<T[number]>[] : T extends object ? {
3
7
  [K in keyof T]: DatesAsStrings<T[K]>;
4
8
  } : T;
5
9
  export {};
@@ -2,9 +2,9 @@ export declare class StringUtil {
2
2
  static convertToHyphenCase(entityName: string, transformToLowerCase?: boolean): string;
3
3
  static parseVariables(variableString: string, data: any, quoteStrings?: boolean): string;
4
4
  static convertToCamelCase(str: any): any;
5
- static convertToTitleCase(str: any): any;
6
- static isString(value: any): value is string | String;
7
- static isArray(value: any): value is any[];
5
+ static convertToTitleCase(str: string): any;
6
+ static isString(value: unknown): value is string;
7
+ static isArray(value: unknown): value is any[];
8
8
  static decodeEncodedString(encodedString: string): string;
9
9
  static getStringSizeInMB(str: string): number;
10
10
  }
@@ -62,7 +62,7 @@ class StringUtil {
62
62
  return withSpaces.charAt(0).toUpperCase() + withSpaces.slice(1);
63
63
  }
64
64
  static isString(value) {
65
- return typeof value === 'string' || value instanceof String;
65
+ return typeof value === 'string';
66
66
  }
67
67
  static isArray(value) {
68
68
  return Array.isArray(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrail/util",
3
- "version": "1.1.18",
3
+ "version": "1.2.0-alpha-otel-1",
4
4
  "description": "General JavaScript utilities",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -39,7 +39,7 @@
39
39
  "testEnvironment": "node"
40
40
  },
41
41
  "dependencies": {
42
- "@contrail/types": "^3.1.2",
42
+ "@contrail/types": "^3.1.3",
43
43
  "fflate": "^0.8.2",
44
44
  "lodash": "^4.17.21"
45
45
  }