ddan-js 4.0.2 → 4.0.3

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,6 @@
1
1
  import { Ddan } from '../../typings';
2
2
  declare function to<T = any, U extends object = any>(promise: Promise<T>, errorExt?: object, fn?: Ddan.noop): Promise<[null, T] | [U, undefined]>;
3
+ declare function jsonParse<T = unknown>(text: string, defaultValue?: T | null): T | null;
3
4
  declare const _default: {
4
5
  to: typeof to;
5
6
  go: <T = any>(task?: Ddan.PFunction<T> | undefined, fn?: Ddan.noop | undefined) => Promise<[any, undefined] | [null, T]>;
@@ -11,5 +12,6 @@ declare const _default: {
11
12
  resolveValue: <T_4 = any>(value: T_4 | (() => T_4)) => T_4;
12
13
  compareVersion: (ver1: string, ver2: string) => 0 | 1 | -1;
13
14
  toOpen: (content: string, defaultOpen?: boolean) => boolean;
15
+ jsonParse: typeof jsonParse;
14
16
  };
15
17
  export default _default;
@@ -53,5 +53,6 @@ declare const _default: {
53
53
  resolveValue: <T_6 = any>(value: T_6 | (() => T_6)) => T_6;
54
54
  compareVersion: (ver1: string, ver2: string) => 0 | 1 | -1;
55
55
  toOpen: (content: string, defaultOpen?: boolean) => boolean;
56
+ jsonParse: <T_7 = unknown>(text: string, defaultValue?: T_7 | null) => T_7 | null;
56
57
  };
57
58
  export default _default;
@@ -157,6 +157,7 @@ declare const dHook: {
157
157
  resolveValue: <T_10 = any>(value: T_10 | (() => T_10)) => T_10;
158
158
  compareVersion: (ver1: string, ver2: string) => 0 | 1 | -1;
159
159
  toOpen: (content: string, defaultOpen?: boolean) => boolean;
160
+ jsonParse: <T_11 = unknown>(text: string, defaultValue?: T_11 | null) => T_11 | null;
160
161
  base64: {
161
162
  encode: (input: string) => string;
162
163
  decode: (base64Str: string) => string;
@@ -213,7 +214,7 @@ declare const dHook: {
213
214
  bytes2hex: (bytes: Uint8Array) => string;
214
215
  toUint32: (str: string) => Uint32Array;
215
216
  fromUint32: (uint32: Uint32Array) => string;
216
- flatten: <T_11>(data: T_11[], recursive?: boolean, list?: T_11[]) => T_11[];
217
+ flatten: <T_12>(data: T_12[], recursive?: boolean, list?: T_12[]) => T_12[];
217
218
  flattenPath: (data: Record<string, any>) => Record<string, any>;
218
219
  normalizeStructure: (data: any, prevData: any) => void;
219
220
  diffPath: (data: Record<string, any>, prevData: Record<string, any>) => Record<string, any>;
@@ -229,12 +230,12 @@ declare const dHook: {
229
230
  ignoreEmptyString?: boolean | undefined;
230
231
  }) => any;
231
232
  clone: (source: any, weakMap?: WeakMap<object, any>) => any;
232
- cloneClass: <T_12>(source: T_12) => T_12;
233
- isEqual: <T_13 = any>(value: T_13, other: T_13, depth?: number) => boolean;
233
+ cloneClass: <T_13>(source: T_13) => T_13;
234
+ isEqual: <T_14 = any>(value: T_14, other: T_14, depth?: number) => boolean;
234
235
  isEqualArray: (value: any[], other: any[], depth?: number) => boolean;
235
236
  isEqualObject: (value: Record<string, any>, other: Record<string, any>, depth?: number) => boolean;
236
- isEqualValue: <T_14>(value: T_14, other: T_14, type: string) => boolean;
237
+ isEqualValue: <T_15>(value: T_15, other: T_15, type: string) => boolean;
237
238
  isEqualAB: (value: ArrayBuffer, other: ArrayBuffer) => boolean;
238
- isEqualDeep: <T_15>(value: T_15, other: T_15) => boolean;
239
+ isEqualDeep: <T_16>(value: T_16, other: T_16) => boolean;
239
240
  };
240
241
  export default dHook;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ddan-js",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "ddan-js",