@wzyjs/utils 0.1.0 → 0.2.2

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.
Files changed (94) hide show
  1. package/dist/cjs/browser/element.d.ts +1 -0
  2. package/dist/cjs/browser/element.d.ts.map +1 -0
  3. package/dist/cjs/browser/index.d.ts +1 -0
  4. package/dist/cjs/browser/index.d.ts.map +1 -0
  5. package/dist/cjs/browser/other.d.ts +1 -0
  6. package/dist/cjs/browser/other.d.ts.map +1 -0
  7. package/dist/cjs/browser/style.d.ts +1 -0
  8. package/dist/cjs/browser/style.d.ts.map +1 -0
  9. package/dist/cjs/browser.d.ts +1 -0
  10. package/dist/cjs/browser.d.ts.map +1 -0
  11. package/dist/cjs/common/classs.d.ts +1 -0
  12. package/dist/cjs/common/classs.d.ts.map +1 -0
  13. package/dist/cjs/common/dayjs.d.ts +4 -0
  14. package/dist/cjs/common/dayjs.d.ts.map +1 -0
  15. package/dist/cjs/common/dayjs.js +13 -1
  16. package/dist/cjs/common/index.d.ts +3 -1
  17. package/dist/cjs/common/index.d.ts.map +1 -0
  18. package/dist/cjs/common/index.js +5 -0
  19. package/dist/cjs/common/number.d.ts +1 -0
  20. package/dist/cjs/common/number.d.ts.map +1 -0
  21. package/dist/cjs/common/object.d.ts +3 -2
  22. package/dist/cjs/common/object.d.ts.map +1 -0
  23. package/dist/cjs/common/other.d.ts +9 -9
  24. package/dist/cjs/common/other.d.ts.map +1 -0
  25. package/dist/cjs/common/other.js +23 -23
  26. package/dist/cjs/common/string.d.ts +5 -1
  27. package/dist/cjs/common/string.d.ts.map +1 -0
  28. package/dist/cjs/node/database/Collection.d.ts +1 -0
  29. package/dist/cjs/node/database/Collection.d.ts.map +1 -0
  30. package/dist/cjs/node/database/Database.d.ts +1 -0
  31. package/dist/cjs/node/database/Database.d.ts.map +1 -0
  32. package/dist/cjs/node/database/index.d.ts +1 -0
  33. package/dist/cjs/node/database/index.d.ts.map +1 -0
  34. package/dist/cjs/node/database/types.d.ts +1 -0
  35. package/dist/cjs/node/database/types.d.ts.map +1 -0
  36. package/dist/cjs/node/database/utils.d.ts +1 -0
  37. package/dist/cjs/node/database/utils.d.ts.map +1 -0
  38. package/dist/cjs/node/index.d.ts +2 -1
  39. package/dist/cjs/node/index.d.ts.map +1 -0
  40. package/dist/cjs/node/index.js +21 -2
  41. package/dist/cjs/node/jsonFile/index.d.ts +1 -0
  42. package/dist/cjs/node/jsonFile/index.d.ts.map +1 -0
  43. package/dist/cjs/node/mail/index.d.ts +1 -0
  44. package/dist/cjs/node/mail/index.d.ts.map +1 -0
  45. package/dist/cjs/node.d.ts +1 -0
  46. package/dist/cjs/node.d.ts.map +1 -0
  47. package/dist/esm/browser/element.d.ts +1 -0
  48. package/dist/esm/browser/element.d.ts.map +1 -0
  49. package/dist/esm/browser/index.d.ts +1 -0
  50. package/dist/esm/browser/index.d.ts.map +1 -0
  51. package/dist/esm/browser/other.d.ts +1 -0
  52. package/dist/esm/browser/other.d.ts.map +1 -0
  53. package/dist/esm/browser/style.d.ts +1 -0
  54. package/dist/esm/browser/style.d.ts.map +1 -0
  55. package/dist/esm/browser.d.ts +1 -0
  56. package/dist/esm/browser.d.ts.map +1 -0
  57. package/dist/esm/common/classs.d.ts +1 -0
  58. package/dist/esm/common/classs.d.ts.map +1 -0
  59. package/dist/esm/common/dayjs.d.ts +4 -0
  60. package/dist/esm/common/dayjs.d.ts.map +1 -0
  61. package/dist/esm/common/dayjs.js +10 -0
  62. package/dist/esm/common/index.d.ts +3 -1
  63. package/dist/esm/common/index.d.ts.map +1 -0
  64. package/dist/esm/common/index.js +3 -2
  65. package/dist/esm/common/number.d.ts +1 -0
  66. package/dist/esm/common/number.d.ts.map +1 -0
  67. package/dist/esm/common/object.d.ts +3 -2
  68. package/dist/esm/common/object.d.ts.map +1 -0
  69. package/dist/esm/common/other.d.ts +9 -9
  70. package/dist/esm/common/other.d.ts.map +1 -0
  71. package/dist/esm/common/other.js +36 -42
  72. package/dist/esm/common/string.d.ts +5 -1
  73. package/dist/esm/common/string.d.ts.map +1 -0
  74. package/dist/esm/common/string.js +1 -1
  75. package/dist/esm/node/database/Collection.d.ts +1 -0
  76. package/dist/esm/node/database/Collection.d.ts.map +1 -0
  77. package/dist/esm/node/database/Database.d.ts +1 -0
  78. package/dist/esm/node/database/Database.d.ts.map +1 -0
  79. package/dist/esm/node/database/index.d.ts +1 -0
  80. package/dist/esm/node/database/index.d.ts.map +1 -0
  81. package/dist/esm/node/database/types.d.ts +1 -0
  82. package/dist/esm/node/database/types.d.ts.map +1 -0
  83. package/dist/esm/node/database/utils.d.ts +1 -0
  84. package/dist/esm/node/database/utils.d.ts.map +1 -0
  85. package/dist/esm/node/index.d.ts +2 -1
  86. package/dist/esm/node/index.d.ts.map +1 -0
  87. package/dist/esm/node/index.js +3 -2
  88. package/dist/esm/node/jsonFile/index.d.ts +1 -0
  89. package/dist/esm/node/jsonFile/index.d.ts.map +1 -0
  90. package/dist/esm/node/mail/index.d.ts +1 -0
  91. package/dist/esm/node/mail/index.d.ts.map +1 -0
  92. package/dist/esm/node.d.ts +1 -0
  93. package/dist/esm/node.d.ts.map +1 -0
  94. package/package.json +6 -3
@@ -7,3 +7,4 @@ export declare const getElement: (el: string | Element) => {
7
7
  originalStyle: CSSStyleDeclaration;
8
8
  };
9
9
  export declare const isElementInViewport: (el: string | Element) => boolean | undefined;
10
+ //# sourceMappingURL=element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["element.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,OAAQ,OAAO,WAAW,qBAAqB,SAKzE,CAAA;AAGD,eAAO,MAAM,UAAU,OAAQ,MAAM,GAAG,OAAO;;;;;;CAa9C,CAAA;AAGD,eAAO,MAAM,mBAAmB,OAAQ,MAAM,GAAG,OAAO,wBAYvD,CAAA"}
@@ -16,3 +16,4 @@ export declare const localforage: {
16
16
  export * from './style';
17
17
  export * from './element';
18
18
  export * from './other';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,IAAI,MAAM,mBAAmB,CAAA;AAGpC,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;AAEvC,eAAO,MAAM,WAAW;;;;;;;;;CAKvB,CAAA;AAED,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
@@ -1 +1,2 @@
1
1
  export declare const readClipboard: () => Promise<string>;
2
+ //# sourceMappingURL=other.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"other.d.ts","sourceRoot":"","sources":["other.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,uBAMzB,CAAA"}
@@ -8,3 +8,4 @@ export declare const hexToRgba: (hexColor: string, a?: number) => {
8
8
  };
9
9
  export declare const flashBackground: (el: string | Element, color: string, a?: number) => void;
10
10
  export declare const flashBorder: (el: string | Element, color: string, a?: number) => void;
11
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["style.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,aAAc,MAAM;;;;;;;CAQzC,CAAA;AAGD,eAAO,MAAM,eAAe,OAAQ,MAAM,GAAG,OAAO,SAAS,MAAM,qBAclE,CAAA;AAGD,eAAO,MAAM,WAAW,OAAQ,MAAM,GAAG,OAAO,SAAS,MAAM,qBAc9D,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export * from './common';
2
2
  export * from './browser/index';
3
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["browser.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA"}
@@ -3,3 +3,4 @@ export declare class CustomError extends Error {
3
3
  data?: any;
4
4
  constructor(message: string, code?: number, data?: any);
5
5
  }
6
+ //# sourceMappingURL=classs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classs.d.ts","sourceRoot":"","sources":["classs.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,GAAG,CAAA;gBAEE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAMvD"}
@@ -1,4 +1,8 @@
1
1
  import dayjs from 'dayjs';
2
2
  import 'dayjs/locale/zh-cn';
3
+ export declare enum Timezone {
4
+ AsiaShanghai = "Asia/Shanghai"
5
+ }
3
6
  export { Dayjs } from 'dayjs';
4
7
  export default dayjs;
8
+ //# sourceMappingURL=dayjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dayjs.d.ts","sourceRoot":"","sources":["dayjs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,oBAAoB,CAAA;AAgB3B,oBAAY,QAAQ;IAClB,YAAY,kBAAkB;CAC/B;AAED,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,eAAe,KAAK,CAAA"}
@@ -30,6 +30,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  var dayjs_exports = {};
31
31
  __export(dayjs_exports, {
32
32
  Dayjs: () => import_dayjs2.Dayjs,
33
+ Timezone: () => Timezone,
33
34
  default: () => dayjs_default
34
35
  });
35
36
  module.exports = __toCommonJS(dayjs_exports);
@@ -39,6 +40,9 @@ var import_weekday = __toESM(require("dayjs/plugin/weekday"));
39
40
  var import_localeData = __toESM(require("dayjs/plugin/localeData"));
40
41
  var import_isoWeek = __toESM(require("dayjs/plugin/isoWeek"));
41
42
  var import_updateLocale = __toESM(require("dayjs/plugin/updateLocale"));
43
+ var import_timezone = __toESM(require("dayjs/plugin/timezone"));
44
+ var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
45
+ var import_isSameOrBefore = __toESM(require("dayjs/plugin/isSameOrBefore"));
42
46
  var import_zh_cn = require("dayjs/locale/zh-cn");
43
47
  var import_dayjs2 = require("dayjs");
44
48
  import_dayjs.default.extend(import_isBetween.default);
@@ -46,12 +50,20 @@ import_dayjs.default.extend(import_weekday.default);
46
50
  import_dayjs.default.extend(import_localeData.default);
47
51
  import_dayjs.default.extend(import_isoWeek.default);
48
52
  import_dayjs.default.extend(import_updateLocale.default);
53
+ import_dayjs.default.extend(import_timezone.default);
54
+ import_dayjs.default.extend(import_isSameOrAfter.default);
55
+ import_dayjs.default.extend(import_isSameOrBefore.default);
49
56
  import_dayjs.default.locale("zh-cn");
50
57
  import_dayjs.default.updateLocale("zh-cn", {
51
58
  weekStart: 1
52
59
  });
60
+ var Timezone = /* @__PURE__ */ ((Timezone2) => {
61
+ Timezone2["AsiaShanghai"] = "Asia/Shanghai";
62
+ return Timezone2;
63
+ })(Timezone || {});
53
64
  var dayjs_default = import_dayjs.default;
54
65
  // Annotate the CommonJS export names for ESM import in node:
55
66
  0 && (module.exports = {
56
- Dayjs
67
+ Dayjs,
68
+ Timezone
57
69
  });
@@ -1,7 +1,7 @@
1
1
  import { cloneDeep, debounce, isBoolean, isEqual, isFunction, isNumber, isObject, isString, merge, omit, pick, uniq, uniqBy, uniqWith, isEmpty, isError, find, groupBy, noop } from 'lodash';
2
2
  export { cloneDeep, debounce, isBoolean, isEqual, isFunction, isNumber, isObject, isString, merge, omit, pick, uniq, uniqBy, uniqWith, isEmpty, isError, find, groupBy, noop, };
3
3
  export * as consola from 'consola';
4
- export { default as dayjs, Dayjs } from './dayjs';
4
+ export { default as dayjs, Dayjs, Timezone } from './dayjs';
5
5
  export * from 'zod';
6
6
  export * from './string';
7
7
  export * from './object';
@@ -9,3 +9,5 @@ export * from './other';
9
9
  export * from './number';
10
10
  export * from './classs';
11
11
  export { default as _ } from 'lodash';
12
+ export { default as axios } from 'axios';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,EACL,MAAM,QAAQ,CAAA;AAEf,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,GACL,CAAA;AAED,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3D,cAAc,KAAK,CAAA;AAEnB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAErC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA"}
@@ -31,7 +31,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
31
31
  var common_exports = {};
32
32
  __export(common_exports, {
33
33
  Dayjs: () => import_dayjs.Dayjs,
34
+ Timezone: () => import_dayjs.Timezone,
34
35
  _: () => import_lodash2.default,
36
+ axios: () => import_axios.default,
35
37
  cloneDeep: () => import_lodash.cloneDeep,
36
38
  consola: () => consola,
37
39
  dayjs: () => import_dayjs.default,
@@ -65,10 +67,13 @@ __reExport(common_exports, require("./other"), module.exports);
65
67
  __reExport(common_exports, require("./number"), module.exports);
66
68
  __reExport(common_exports, require("./classs"), module.exports);
67
69
  var import_lodash2 = __toESM(require("lodash"));
70
+ var import_axios = __toESM(require("axios"));
68
71
  // Annotate the CommonJS export names for ESM import in node:
69
72
  0 && (module.exports = {
70
73
  Dayjs,
74
+ Timezone,
71
75
  _,
76
+ axios,
72
77
  cloneDeep,
73
78
  consola,
74
79
  dayjs,
@@ -1,3 +1,4 @@
1
1
  export declare const getRandomNum: (min: number, max: number) => number;
2
2
  export declare const limitDecimals: (v: string, num: number | undefined, isForce: boolean) => string;
3
3
  export declare const getFileSize: (size: number) => string;
4
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["number.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY,QAAS,MAAM,OAAO,MAAM,WAEpD,CAAA;AAGD,eAAO,MAAM,aAAa,MAAO,MAAM,oCAAoB,OAAO,KAAG,MAUpE,CAAA;AAGD,eAAO,MAAM,WAAW,SAAU,MAAM,WASvC,CAAA"}
@@ -1,10 +1,11 @@
1
1
  export declare const findItem: <I>(list: I[], attr: keyof I, value?: I[keyof I] | undefined) => I | undefined;
2
2
  export declare const filterParams: (params: {
3
3
  [key: string]: any;
4
- }) => {};
4
+ }) => any;
5
5
  export declare const watch: {
6
6
  observe(obj: {
7
7
  [key: string]: any;
8
8
  }, key: string, watchFun: (value: any, val: any) => undefined): void;
9
- setWatcher(data?: {}, watch?: {}): void;
9
+ setWatcher(data?: {}, watch?: any): void;
10
10
  };
11
+ //# sourceMappingURL=object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["object.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,gFAEpB,CAAA;AAiCD,eAAO,MAAM,YAAY;;SAOxB,CAAA;AAGD,eAAO,MAAM,KAAK;;;YAC0B,MAAM,oBAAoB,GAAG,OAAO,GAAG,KAAK,SAAS;;CAuBhG,CAAA"}
@@ -1,11 +1,8 @@
1
- import { KeyValue, OrderParams, Pagination, SortParams } from '@wzyjs/types';
2
- export declare const handleParams: (params?: Pagination & KeyValue, sort?: SortParams) => {
3
- page: {
4
- size?: number | undefined;
5
- current?: number | undefined;
6
- };
7
- where: KeyValue<string, string | number | boolean | RegExp>;
8
- order?: OrderParams<string> | undefined;
1
+ import { FilterParams, Order, Pagination, SortParams, Where } from '@wzyjs/types';
2
+ export declare const handleParams: <I>(params: Pagination & I, sort: SortParams, filter: FilterParams, additional?: Where) => {
3
+ where?: Where | undefined;
4
+ order?: Order | undefined;
5
+ pagination?: Pagination | undefined;
9
6
  };
10
7
  export declare const handleRes2List: <D>(reqPromise: any) => Promise<{
11
8
  label: string;
@@ -16,7 +13,9 @@ export declare const executePromise: (promise: Promise<any>) => Promise<{
16
13
  time: number;
17
14
  }>;
18
15
  export declare const locationFn: {
19
- url2Params: (url?: string) => {};
16
+ url2Params: (url?: string) => {
17
+ [key: string]: string;
18
+ };
20
19
  params2Url: (params: {
21
20
  [key: string]: any;
22
21
  }) => string;
@@ -24,3 +23,4 @@ export declare const locationFn: {
24
23
  urlGetPath: (url?: string) => string;
25
24
  };
26
25
  export declare const delay: (time?: number) => Promise<unknown>;
26
+ //# sourceMappingURL=other.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"other.d.ts","sourceRoot":"","sources":["other.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAGjF,eAAO,MAAM,YAAY,oCAEjB,UAAU,UACR,YAAY,eACP,KAAK;;;;CAgCnB,CAAA;AAGD,eAAO,MAAM,cAAc,kBAAyB,GAAG,KAAG,QAAQ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAMnG,CAAA;AAGD,eAAO,MAAM,cAAc,YAAmB,QAAQ,GAAG,CAAC;;;EAQzD,CAAA;AAGD,eAAO,MAAM,UAAU;;;;;;;wBA2BD,MAAM,SAAS,GAAG,YAAY,MAAM;;CAiCzD,CAAA;AAGD,eAAO,MAAM,KAAK,qCAEjB,CAAA"}
@@ -27,36 +27,36 @@ __export(other_exports, {
27
27
  });
28
28
  module.exports = __toCommonJS(other_exports);
29
29
  var import_lodash = require("lodash");
30
- var handleParams = (params, sort) => {
31
- if (!params) {
32
- return {
33
- page: {},
34
- where: {}
35
- };
36
- }
37
- const { current, pageSize, ...other } = params;
30
+ var handleParams = (params, sort, filter, additional) => {
31
+ const { current = 1, pageSize = 10, ...where } = params || {};
32
+ const where_ = {
33
+ ...additional || {},
34
+ ...where || {},
35
+ ...filter || {}
36
+ };
37
+ const order_ = Object.keys(sort).reduce((acc, key) => {
38
+ const value = sort[key];
39
+ if (value === "ascend") {
40
+ acc[key] = "asc";
41
+ } else if (value === "descend") {
42
+ acc[key] = "desc";
43
+ }
44
+ return acc;
45
+ }, {});
38
46
  return {
39
- page: {
40
- current: current || 1,
41
- size: pageSize || 10
42
- },
43
- where: Object.entries(other).reduce((acc, [key, value]) => {
44
- if (key && value) {
45
- acc[key] = typeof value === "string" ? new RegExp(value) : value;
46
- }
47
- return acc;
48
- }, {}),
49
- order: sort && {
50
- field: Object.keys(sort)[0],
51
- type: Object.values(sort)[0] === "ascend" ? "asc" : "desc"
47
+ where: Object.keys(where_).length ? where_ : void 0,
48
+ order: Object.keys(order_).length ? order_ : void 0,
49
+ pagination: {
50
+ current,
51
+ pageSize
52
52
  }
53
53
  };
54
54
  };
55
55
  var handleRes2List = async (reqPromise) => {
56
56
  const { data } = await reqPromise();
57
- return ((data == null ? void 0 : data.list) || []).map((item) => ({
57
+ return ((data == null ? void 0 : data.data) || []).map((item) => ({
58
58
  label: item.name,
59
- value: item._id || item.key
59
+ value: item.id || item.key
60
60
  }));
61
61
  };
62
62
  var executePromise = async (promise) => {
@@ -1,7 +1,10 @@
1
1
  export declare const getChineseByStr: (str: string) => string;
2
2
  export declare const getStrLength: (value: string) => number;
3
3
  export declare const replaceAll: (str: string, searchValue: string, replaceValue: string) => string;
4
- export declare const replaceByRules: (str: string, rules: [string, string][]) => string;
4
+ export declare const replaceByRules: (str: string, rules: [
5
+ string,
6
+ string
7
+ ][]) => string;
5
8
  export declare const getType: (value: any) => string;
6
9
  export declare const amount: (str: string) => string;
7
10
  export declare const jsonParse: (value: string | object) => object;
@@ -14,3 +17,4 @@ export declare const getSliceStr: (str: string, before: string, after: string) =
14
17
  export declare const getProxyUrl: (url: string) => string;
15
18
  export declare const getLength: (value: string) => number;
16
19
  export declare const getCookie: (name: string) => string | null;
20
+ //# sourceMappingURL=string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["string.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,QAAS,MAAM,KAAG,MAW7C,CAAA;AAGD,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,MAM5C,CAAA;AAGD,eAAO,MAAM,UAAU,QAAS,MAAM,eAAe,MAAM,gBAAgB,MAAM,KAAG,MAYnF,CAAA;AAGD,eAAO,MAAM,cAAc,QAAS,MAAM,SAAS;IAAC,MAAM;IAAE,MAAM;CAAC,EAAE,WAKpE,CAAA;AAGD,eAAO,MAAM,OAAO,UAAW,GAAG,WAEjC,CAAA;AAGD,eAAO,MAAM,MAAM,QAAS,MAAM,WAGjC,CAAA;AAGD,eAAO,MAAM,SAAS,UAAW,MAAM,GAAG,MAAM,KAAG,MASlD,CAAA;AAGD,eAAO,MAAM,MAAM,QAAS,MAAM,YAQjC,CAAA;AAGD,eAAO,MAAM,QAAQ,UAAW,GAAG,WAElC,CAAA;AAGD,eAAO,MAAM,cAAc,QAAO,MAOjC,CAAA;AAGD,eAAO,MAAM,eAAe,uBAAiB,MAE5C,CAAA;AAGD,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MAWxC,CAAA;AAGD,eAAO,MAAM,WAAW,QAAS,MAAM,UAAU,MAAM,SAAS,MAAM,WAErE,CAAA;AAGD,eAAO,MAAM,WAAW,QAAS,MAAM,WAGtC,CAAA;AAGD,eAAO,MAAM,SAAS,UAAW,MAAM,WAGtC,CAAA;AAGD,eAAO,MAAM,SAAS,SAAU,MAAM,kBAIrC,CAAA"}
@@ -20,3 +20,4 @@ export declare class Collection<D extends IKeyValue> {
20
20
  findList(conditions?: WhereConditions): Promise<FindList.Res<D>>;
21
21
  count(conditions: Conditions): Promise<Count.Res>;
22
22
  }
23
+ //# sourceMappingURL=Collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collection.d.ts","sourceRoot":"","sources":["Collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAa,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGpE,OAAO,EACL,GAAG,EACH,UAAU,EACV,KAAK,EACL,MAAM,EACN,IAAI,EACJ,QAAQ,EACR,YAAY,EAKZ,YAAY,EAEZ,MAAM,EACN,eAAe,EAChB,MAAM,SAAS,CAAA;AAEhB,qBAAa,UAAU,CAAC,CAAC,SAAS,SAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAA;IACnB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAA;gBAEf,EAAE,EAAE,QAAQ,CAAC,EAAE,EAAE,IAAI,EAAE,MAAM;IAMzC,OAAO,CAAC,cAAc;IAiDtB,OAAO,CAAC,OAAO;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AAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAKnD,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAKhE,KAAK,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;CAGlD"}
@@ -8,3 +8,4 @@ export declare class Database {
8
8
  collection<D extends IKeyValue>(name: string): Collection<D>;
9
9
  createCollection(name: string): tcb.IBaseRes;
10
10
  }
11
+ //# sourceMappingURL=Database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Database.d.ts","sourceRoot":"","sources":["Database.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAQ,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAiB;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+C;gBAE5D,MAAM,EAAE,MAAM;IAKnB,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;IAQ5D,gBAAgB,CAAC,IAAI,EAAE,MAAM;CAGrC"}
@@ -1,2 +1,3 @@
1
1
  export { Database } from './Database';
2
2
  export { Conditions, IdConditions, WhereConditions, Record } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA"}
@@ -149,3 +149,4 @@ export declare type Record<D> = D & {
149
149
  createAt: number;
150
150
  updateAt: number;
151
151
  };
152
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGzD,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAGD,oBAAY,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;KAAE,CAAA;IAC3C,OAAO,CAAC,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,KAAK,CAAA;KACjB,CAAA;CACF,CAAA;AAGD,oBAAY,OAAO;IACjB,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,IAAI,SAAS;CACd;AAED,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;IACjB,KAAK,EAAE,GAAG,CAAA;CACX,GAAG;IACF,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;IAClB,KAAK,EAAE,GAAG,CAAA;CACX,GAAG;IACF,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;IACjB,KAAK,EAAE,MAAM,CAAA;CACd,GAAG;IACF,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC;IAClB,KAAK,EAAE,MAAM,CAAA;CACd,GAAG;IACF,IAAI,EAAE,OAAO,CAAC,EAAE,CAAC;IACjB,KAAK,EAA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GAAG,CAAC,CAAC,IAAI;QACnB,OAAO,CAAC,EAAE,MAAM,CAAA;QAChB,GAAG,CAAC,EAAE,CAAC,CAAA;KACR,CAAA;CACF;AAGD,yBAAiB,KAAK,CAAC;IACrB,KAAY,MAAM,GAAG;QACnB,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC;QACrB,UAAU,CAAC,EAAE,eAAe,CAAA;KAC7B,CAAA;IACD,KAAY,GAAG,GAAG;QAChB,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAA;CACF;AAGD,oBAAY,YAAY,CAAC,CAAC,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAA;AAG7H,oBAAY,SAAS,CAAC,CAAC,IAAI,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAA;AAG3G,oBAAY,IAAI,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,GAAG,SAAS,CAAA;AAGpH,oBAAY,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import { Conditions } from './types';
2
2
  export declare const appendTime: <D>(data: D, type: 'create' | 'update') => D;
3
3
  export declare const defaultConditions: Conditions;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGpC,eAAO,MAAM,UAAU,qBAAsB,QAAQ,GAAG,QAAQ,MAQ/D,CAAA;AAGD,eAAO,MAAM,iBAAiB,EAAE,UAa/B,CAAA"}
@@ -1,3 +1,4 @@
1
- export * from './database';
2
1
  export * from './jsonFile';
3
2
  export * from './mail';
3
+ export { default as DataStore, DataStoreOptions } from 'nedb';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AAEtB,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAA"}
@@ -1,7 +1,13 @@
1
+ var __create = Object.create;
1
2
  var __defProp = Object.defineProperty;
2
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
4
6
  var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
5
11
  var __copyProps = (to, from, except, desc) => {
6
12
  if (from && typeof from === "object" || typeof from === "function") {
7
13
  for (let key of __getOwnPropNames(from))
@@ -11,17 +17,30 @@ var __copyProps = (to, from, except, desc) => {
11
17
  return to;
12
18
  };
13
19
  var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
14
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
15
29
 
16
30
  // src/node/index.ts
17
31
  var node_exports = {};
32
+ __export(node_exports, {
33
+ DataStore: () => import_nedb.default,
34
+ DataStoreOptions: () => import_nedb.DataStoreOptions
35
+ });
18
36
  module.exports = __toCommonJS(node_exports);
19
- __reExport(node_exports, require("./database"), module.exports);
20
37
  __reExport(node_exports, require("./jsonFile"), module.exports);
21
38
  __reExport(node_exports, require("./mail"), module.exports);
39
+ var import_nedb = __toESM(require("nedb"));
22
40
  // Annotate the CommonJS export names for ESM import in node:
23
41
  0 && (module.exports = {
24
- ...require("./database"),
42
+ DataStore,
43
+ DataStoreOptions,
25
44
  ...require("./jsonFile"),
26
45
  ...require("./mail")
27
46
  });
@@ -4,3 +4,4 @@ export declare class JsonFile {
4
4
  get(key: string): Promise<unknown>;
5
5
  set(key: string, value: any): void;
6
6
  }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAIA,qBAAa,QAAQ;IACnB,QAAQ,EAAE,MAAM,CAAC;gBAEL,QAAQ,EAAE,MAAM;IAI5B,GAAG,CAAC,GAAG,EAAE,MAAM;IASf,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;CAQ5B"}
@@ -1 +1,2 @@
1
1
  export declare const sendMail: (toEmail: string, title: string, content?: string) => Promise<string>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,YAAmB,MAAM,SAAS,MAAM,YAAY,MAAM,oBAY9E,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export * from './common';
2
2
  export * from './node/index';
3
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["node.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA"}
@@ -7,3 +7,4 @@ export declare const getElement: (el: string | Element) => {
7
7
  originalStyle: CSSStyleDeclaration;
8
8
  };
9
9
  export declare const isElementInViewport: (el: string | Element) => boolean | undefined;
10
+ //# sourceMappingURL=element.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"element.d.ts","sourceRoot":"","sources":["element.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,cAAc,OAAQ,OAAO,WAAW,qBAAqB,SAKzE,CAAA;AAGD,eAAO,MAAM,UAAU,OAAQ,MAAM,GAAG,OAAO;;;;;;CAa9C,CAAA;AAGD,eAAO,MAAM,mBAAmB,OAAQ,MAAM,GAAG,OAAO,wBAYvD,CAAA"}
@@ -16,3 +16,4 @@ export declare const localforage: {
16
16
  export * from './style';
17
17
  export * from './element';
18
18
  export * from './other';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,KAAK,CAAA;AACrB,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,IAAI,MAAM,mBAAmB,CAAA;AAGpC,OAAO,KAAK,MAAM,SAAS,CAAA;AAE3B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,KAAK,EAAE,CAAA;AAEvC,eAAO,MAAM,WAAW;;;;;;;;;CAKvB,CAAA;AAED,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA"}
@@ -1 +1,2 @@
1
1
  export declare const readClipboard: () => Promise<string>;
2
+ //# sourceMappingURL=other.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"other.d.ts","sourceRoot":"","sources":["other.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,uBAMzB,CAAA"}
@@ -8,3 +8,4 @@ export declare const hexToRgba: (hexColor: string, a?: number) => {
8
8
  };
9
9
  export declare const flashBackground: (el: string | Element, color: string, a?: number) => void;
10
10
  export declare const flashBorder: (el: string | Element, color: string, a?: number) => void;
11
+ //# sourceMappingURL=style.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style.d.ts","sourceRoot":"","sources":["style.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,SAAS,aAAc,MAAM;;;;;;;CAQzC,CAAA;AAGD,eAAO,MAAM,eAAe,OAAQ,MAAM,GAAG,OAAO,SAAS,MAAM,qBAclE,CAAA;AAGD,eAAO,MAAM,WAAW,OAAQ,MAAM,GAAG,OAAO,SAAS,MAAM,qBAc9D,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export * from './common';
2
2
  export * from './browser/index';
3
+ //# sourceMappingURL=browser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["browser.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,iBAAiB,CAAA"}
@@ -3,3 +3,4 @@ export declare class CustomError extends Error {
3
3
  data?: any;
4
4
  constructor(message: string, code?: number, data?: any);
5
5
  }
6
+ //# sourceMappingURL=classs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"classs.d.ts","sourceRoot":"","sources":["classs.ts"],"names":[],"mappings":"AAAA,qBAAa,WAAY,SAAQ,KAAK;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,GAAG,CAAA;gBAEE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,GAAG;CAMvD"}
@@ -1,4 +1,8 @@
1
1
  import dayjs from 'dayjs';
2
2
  import 'dayjs/locale/zh-cn';
3
+ export declare enum Timezone {
4
+ AsiaShanghai = "Asia/Shanghai"
5
+ }
3
6
  export { Dayjs } from 'dayjs';
4
7
  export default dayjs;
8
+ //# sourceMappingURL=dayjs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dayjs.d.ts","sourceRoot":"","sources":["dayjs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AASzB,OAAO,oBAAoB,CAAA;AAgB3B,oBAAY,QAAQ;IAClB,YAAY,kBAAkB;CAC/B;AAED,OAAO,EAAE,KAAK,EAAE,MAAM,OAAO,CAAA;AAE7B,eAAe,KAAK,CAAA"}
@@ -4,15 +4,25 @@ import weekday from 'dayjs/plugin/weekday';
4
4
  import localeData from 'dayjs/plugin/localeData';
5
5
  import isoWeek from 'dayjs/plugin/isoWeek';
6
6
  import updateLocale from 'dayjs/plugin/updateLocale';
7
+ import timezone from 'dayjs/plugin/timezone';
8
+ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
9
+ import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
7
10
  import 'dayjs/locale/zh-cn';
8
11
  dayjs.extend(isBetween);
9
12
  dayjs.extend(weekday);
10
13
  dayjs.extend(localeData);
11
14
  dayjs.extend(isoWeek);
12
15
  dayjs.extend(updateLocale);
16
+ dayjs.extend(timezone);
17
+ dayjs.extend(isSameOrAfter);
18
+ dayjs.extend(isSameOrBefore);
13
19
  dayjs.locale('zh-cn');
14
20
  dayjs.updateLocale('zh-cn', {
15
21
  weekStart: 1
16
22
  });
23
+ export var Timezone = /*#__PURE__*/function (Timezone) {
24
+ Timezone["AsiaShanghai"] = "Asia/Shanghai";
25
+ return Timezone;
26
+ }({});
17
27
  export { Dayjs } from 'dayjs';
18
28
  export default dayjs;
@@ -1,7 +1,7 @@
1
1
  import { cloneDeep, debounce, isBoolean, isEqual, isFunction, isNumber, isObject, isString, merge, omit, pick, uniq, uniqBy, uniqWith, isEmpty, isError, find, groupBy, noop } from 'lodash';
2
2
  export { cloneDeep, debounce, isBoolean, isEqual, isFunction, isNumber, isObject, isString, merge, omit, pick, uniq, uniqBy, uniqWith, isEmpty, isError, find, groupBy, noop, };
3
3
  export * as consola from 'consola';
4
- export { default as dayjs, Dayjs } from './dayjs';
4
+ export { default as dayjs, Dayjs, Timezone } from './dayjs';
5
5
  export * from 'zod';
6
6
  export * from './string';
7
7
  export * from './object';
@@ -9,3 +9,5 @@ export * from './other';
9
9
  export * from './number';
10
10
  export * from './classs';
11
11
  export { default as _ } from 'lodash';
12
+ export { default as axios } from 'axios';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,EACL,MAAM,QAAQ,CAAA;AAEf,OAAO,EACL,SAAS,EACT,QAAQ,EACR,SAAS,EACT,OAAO,EACP,UAAU,EACV,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,IAAI,EACJ,OAAO,EACP,IAAI,GACL,CAAA;AAED,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAE3D,cAAc,KAAK,CAAA;AAEnB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,UAAU,CAAA;AACxB,cAAc,UAAU,CAAA;AAExB,OAAO,EAAE,OAAO,IAAI,CAAC,EAAE,MAAM,QAAQ,CAAA;AAErC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,OAAO,CAAA"}
@@ -2,11 +2,12 @@ import { cloneDeep, debounce, isBoolean, isEqual, isFunction, isNumber, isObject
2
2
  export { cloneDeep, debounce, isBoolean, isEqual, isFunction, isNumber, isObject, isString, merge, omit, pick, uniq, uniqBy, uniqWith, isEmpty, isError, find, groupBy, noop };
3
3
  import * as _consola from 'consola';
4
4
  export { _consola as consola };
5
- export { default as dayjs, Dayjs } from "./dayjs";
5
+ export { default as dayjs, Dayjs, Timezone } from "./dayjs";
6
6
  export * from 'zod';
7
7
  export * from "./string";
8
8
  export * from "./object";
9
9
  export * from "./other";
10
10
  export * from "./number";
11
11
  export * from "./classs";
12
- export { default as _ } from 'lodash';
12
+ export { default as _ } from 'lodash';
13
+ export { default as axios } from 'axios';
@@ -1,3 +1,4 @@
1
1
  export declare const getRandomNum: (min: number, max: number) => number;
2
2
  export declare const limitDecimals: (v: string, num: number | undefined, isForce: boolean) => string;
3
3
  export declare const getFileSize: (size: number) => string;
4
+ //# sourceMappingURL=number.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"number.d.ts","sourceRoot":"","sources":["number.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY,QAAS,MAAM,OAAO,MAAM,WAEpD,CAAA;AAGD,eAAO,MAAM,aAAa,MAAO,MAAM,oCAAoB,OAAO,KAAG,MAUpE,CAAA;AAGD,eAAO,MAAM,WAAW,SAAU,MAAM,WASvC,CAAA"}
@@ -1,10 +1,11 @@
1
1
  export declare const findItem: <I>(list: I[], attr: keyof I, value?: I[keyof I] | undefined) => I | undefined;
2
2
  export declare const filterParams: (params: {
3
3
  [key: string]: any;
4
- }) => {};
4
+ }) => any;
5
5
  export declare const watch: {
6
6
  observe(obj: {
7
7
  [key: string]: any;
8
8
  }, key: string, watchFun: (value: any, val: any) => undefined): void;
9
- setWatcher(data?: {}, watch?: {}): void;
9
+ setWatcher(data?: {}, watch?: any): void;
10
10
  };
11
+ //# sourceMappingURL=object.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"object.d.ts","sourceRoot":"","sources":["object.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,QAAQ,gFAEpB,CAAA;AAiCD,eAAO,MAAM,YAAY;;SAOxB,CAAA;AAGD,eAAO,MAAM,KAAK;;;YAC0B,MAAM,oBAAoB,GAAG,OAAO,GAAG,KAAK,SAAS;;CAuBhG,CAAA"}
@@ -1,11 +1,8 @@
1
- import { KeyValue, OrderParams, Pagination, SortParams } from '@wzyjs/types';
2
- export declare const handleParams: (params?: Pagination & KeyValue, sort?: SortParams) => {
3
- page: {
4
- size?: number | undefined;
5
- current?: number | undefined;
6
- };
7
- where: KeyValue<string, string | number | boolean | RegExp>;
8
- order?: OrderParams<string> | undefined;
1
+ import { FilterParams, Order, Pagination, SortParams, Where } from '@wzyjs/types';
2
+ export declare const handleParams: <I>(params: Pagination & I, sort: SortParams, filter: FilterParams, additional?: Where) => {
3
+ where?: Where | undefined;
4
+ order?: Order | undefined;
5
+ pagination?: Pagination | undefined;
9
6
  };
10
7
  export declare const handleRes2List: <D>(reqPromise: any) => Promise<{
11
8
  label: string;
@@ -16,7 +13,9 @@ export declare const executePromise: (promise: Promise<any>) => Promise<{
16
13
  time: number;
17
14
  }>;
18
15
  export declare const locationFn: {
19
- url2Params: (url?: string) => {};
16
+ url2Params: (url?: string) => {
17
+ [key: string]: string;
18
+ };
20
19
  params2Url: (params: {
21
20
  [key: string]: any;
22
21
  }) => string;
@@ -24,3 +23,4 @@ export declare const locationFn: {
24
23
  urlGetPath: (url?: string) => string;
25
24
  };
26
25
  export declare const delay: (time?: number) => Promise<unknown>;
26
+ //# sourceMappingURL=other.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"other.d.ts","sourceRoot":"","sources":["other.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAGjF,eAAO,MAAM,YAAY,oCAEjB,UAAU,UACR,YAAY,eACP,KAAK;;;;CAgCnB,CAAA;AAGD,eAAO,MAAM,cAAc,kBAAyB,GAAG,KAAG,QAAQ;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,CAMnG,CAAA;AAGD,eAAO,MAAM,cAAc,YAAmB,QAAQ,GAAG,CAAC;;;EAQzD,CAAA;AAGD,eAAO,MAAM,UAAU;;;;;;;wBA2BD,MAAM,SAAS,GAAG,YAAY,MAAM;;CAiCzD,CAAA;AAGD,eAAO,MAAM,KAAK,qCAEjB,CAAA"}
@@ -3,50 +3,45 @@ var _excluded = ["current", "pageSize"];
3
3
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
4
4
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5
5
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
6
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
7
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
9
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
10
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
12
11
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
13
12
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
14
13
  import { pick } from 'lodash';
15
- // 处理 ProComponents 中 ProTable 参数中的 page 和 where 和 sort
16
- export var handleParams = function handleParams(params, sort) {
17
- if (!params) {
18
- return {
19
- page: {},
20
- where: {}
21
- };
22
- }
23
- var current = params.current,
24
- pageSize = params.pageSize,
25
- other = _objectWithoutProperties(params, _excluded);
14
+ // 处理 ProTable 参数中的 pagination 和 where 和 sort
15
+ export var handleParams = function handleParams(params, sort, filter, additional) {
16
+ var _ref = params || {},
17
+ _ref$current = _ref.current,
18
+ current = _ref$current === void 0 ? 1 : _ref$current,
19
+ _ref$pageSize = _ref.pageSize,
20
+ pageSize = _ref$pageSize === void 0 ? 10 : _ref$pageSize,
21
+ where = _objectWithoutProperties(_ref, _excluded);
22
+ var where_ = _objectSpread(_objectSpread(_objectSpread({}, additional || {}), where || {}), filter || {});
23
+ var order_ = Object.keys(sort).reduce(function (acc, key) {
24
+ var value = sort[key];
25
+ if (value === 'ascend') {
26
+ acc[key] = 'asc';
27
+ } else if (value === 'descend') {
28
+ acc[key] = 'desc';
29
+ }
30
+ return acc;
31
+ }, {});
26
32
  return {
27
- page: {
28
- current: current || 1,
29
- size: pageSize || 10
30
- },
31
- where: Object.entries(other).reduce(function (acc, _ref) {
32
- var _ref2 = _slicedToArray(_ref, 2),
33
- key = _ref2[0],
34
- value = _ref2[1];
35
- if (key && value) {
36
- acc[key] = typeof value === 'string' ? new RegExp(value) : value;
37
- }
38
- return acc;
39
- }, {}),
40
- order: sort && {
41
- field: Object.keys(sort)[0],
42
- type: Object.values(sort)[0] === 'ascend' ? 'asc' : 'desc'
33
+ where: Object.keys(where_).length ? where_ : undefined,
34
+ order: Object.keys(order_).length ? order_ : undefined,
35
+ pagination: {
36
+ current: current,
37
+ pageSize: pageSize
43
38
  }
44
39
  };
45
40
  };
46
41
 
47
42
  // 将 list 的数据处理为 { label: string, value: string }[]
48
43
  export var handleRes2List = /*#__PURE__*/function () {
49
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(reqPromise) {
44
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(reqPromise) {
50
45
  var _yield$reqPromise, data;
51
46
  return _regeneratorRuntime().wrap(function _callee$(_context) {
52
47
  while (1) switch (_context.prev = _context.next) {
@@ -56,10 +51,10 @@ export var handleRes2List = /*#__PURE__*/function () {
56
51
  case 2:
57
52
  _yield$reqPromise = _context.sent;
58
53
  data = _yield$reqPromise.data;
59
- return _context.abrupt("return", ((data === null || data === void 0 ? void 0 : data.list) || []).map(function (item) {
54
+ return _context.abrupt("return", ((data === null || data === void 0 ? void 0 : data.data) || []).map(function (item) {
60
55
  return {
61
56
  label: item.name,
62
- value: item._id || item.key
57
+ value: item.id || item.key
63
58
  };
64
59
  }));
65
60
  case 5:
@@ -68,14 +63,14 @@ export var handleRes2List = /*#__PURE__*/function () {
68
63
  }
69
64
  }, _callee);
70
65
  }));
71
- return function handleRes2List(_x2) {
72
- return _ref3.apply(this, arguments);
66
+ return function handleRes2List(_x) {
67
+ return _ref2.apply(this, arguments);
73
68
  };
74
69
  }();
75
70
 
76
71
  // 计算执行 promise 花费的时间
77
72
  export var executePromise = /*#__PURE__*/function () {
78
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(promise) {
73
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(promise) {
79
74
  var start, result, time;
80
75
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
81
76
  while (1) switch (_context2.prev = _context2.next) {
@@ -96,8 +91,8 @@ export var executePromise = /*#__PURE__*/function () {
96
91
  }
97
92
  }, _callee2);
98
93
  }));
99
- return function executePromise(_x3) {
100
- return _ref4.apply(this, arguments);
94
+ return function executePromise(_x2) {
95
+ return _ref3.apply(this, arguments);
101
96
  };
102
97
  }();
103
98
 
@@ -112,7 +107,6 @@ export var locationFn = {
112
107
  var str = url.slice(url.indexOf('?') + 1);
113
108
  var strs = str.split('&');
114
109
  for (var i = 0; i < strs.length; i++) {
115
- // @ts-ignore
116
110
  jsonList[strs[i].split('=')[0]] = strs[i].split('=')[1]; // 如果出现乱码的话,可以用decodeURI()进行解码
117
111
  }
118
112
  }
@@ -1,7 +1,10 @@
1
1
  export declare const getChineseByStr: (str: string) => string;
2
2
  export declare const getStrLength: (value: string) => number;
3
3
  export declare const replaceAll: (str: string, searchValue: string, replaceValue: string) => string;
4
- export declare const replaceByRules: (str: string, rules: [string, string][]) => string;
4
+ export declare const replaceByRules: (str: string, rules: [
5
+ string,
6
+ string
7
+ ][]) => string;
5
8
  export declare const getType: (value: any) => string;
6
9
  export declare const amount: (str: string) => string;
7
10
  export declare const jsonParse: (value: string | object) => object;
@@ -14,3 +17,4 @@ export declare const getSliceStr: (str: string, before: string, after: string) =
14
17
  export declare const getProxyUrl: (url: string) => string;
15
18
  export declare const getLength: (value: string) => number;
16
19
  export declare const getCookie: (name: string) => string | null;
20
+ //# sourceMappingURL=string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string.d.ts","sourceRoot":"","sources":["string.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,eAAe,QAAS,MAAM,KAAG,MAW7C,CAAA;AAGD,eAAO,MAAM,YAAY,UAAW,MAAM,KAAG,MAM5C,CAAA;AAGD,eAAO,MAAM,UAAU,QAAS,MAAM,eAAe,MAAM,gBAAgB,MAAM,KAAG,MAYnF,CAAA;AAGD,eAAO,MAAM,cAAc,QAAS,MAAM,SAAS;IAAC,MAAM;IAAE,MAAM;CAAC,EAAE,WAKpE,CAAA;AAGD,eAAO,MAAM,OAAO,UAAW,GAAG,WAEjC,CAAA;AAGD,eAAO,MAAM,MAAM,QAAS,MAAM,WAGjC,CAAA;AAGD,eAAO,MAAM,SAAS,UAAW,MAAM,GAAG,MAAM,KAAG,MASlD,CAAA;AAGD,eAAO,MAAM,MAAM,QAAS,MAAM,YAQjC,CAAA;AAGD,eAAO,MAAM,QAAQ,UAAW,GAAG,WAElC,CAAA;AAGD,eAAO,MAAM,cAAc,QAAO,MAOjC,CAAA;AAGD,eAAO,MAAM,eAAe,uBAAiB,MAE5C,CAAA;AAGD,eAAO,MAAM,UAAU,QAAS,MAAM,KAAG,MAWxC,CAAA;AAGD,eAAO,MAAM,WAAW,QAAS,MAAM,UAAU,MAAM,SAAS,MAAM,WAErE,CAAA;AAGD,eAAO,MAAM,WAAW,QAAS,MAAM,WAGtC,CAAA;AAGD,eAAO,MAAM,SAAS,UAAW,MAAM,WAGtC,CAAA;AAGD,eAAO,MAAM,SAAS,SAAU,MAAM,kBAIrC,CAAA"}
@@ -72,7 +72,7 @@ export var jsonParse = function jsonParse(value) {
72
72
  }
73
73
  };
74
74
 
75
- // 是否为json字符串
75
+ // 是否为json对象的字符串
76
76
  export var isJson = function isJson(str) {
77
77
  try {
78
78
  if (getType(JSON.parse(str)) === 'Object') {
@@ -20,3 +20,4 @@ export declare class Collection<D extends IKeyValue> {
20
20
  findList(conditions?: WhereConditions): Promise<FindList.Res<D>>;
21
21
  count(conditions: Conditions): Promise<Count.Res>;
22
22
  }
23
+ //# sourceMappingURL=Collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Collection.d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M,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACpG,MAAM,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACtG,MAAM,CAAC,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,CAAC,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAMpH,IAAI,CAAC,UAAU,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAKnD,QAAQ,CAAC,UAAU,CAAC,EAAE,eAAe,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAKhE,KAAK,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC;CAGlD"}
@@ -8,3 +8,4 @@ export declare class Database {
8
8
  collection<D extends IKeyValue>(name: string): Collection<D>;
9
9
  createCollection(name: string): tcb.IBaseRes;
10
10
  }
11
+ //# sourceMappingURL=Database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Database.d.ts","sourceRoot":"","sources":["Database.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAQ,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,qBAAa,QAAQ;IACnB,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAiB;IACpC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA+C;gBAE5D,MAAM,EAAE,MAAM;IAKnB,UAAU,CAAC,CAAC,SAAS,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,CAAC,CAAC,CAAC;IAQ5D,gBAAgB,CAAC,IAAI,EAAE,MAAM;CAGrC"}
@@ -1,2 +1,3 @@
1
1
  export { Database } from './Database';
2
2
  export { Conditions, IdConditions, WhereConditions, Record } from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA"}
@@ -149,3 +149,4 @@ export declare type Record<D> = D & {
149
149
  createAt: number;
150
150
  updateAt: number;
151
151
  };
152
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAGzD,MAAM,WAAW,MAAM;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAA;CAClB;AAGD,oBAAY,YAAY,GAAG;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,EAAE,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,CAAA;KAAE,CAAA;IAC3C,OAAO,CAAC,EAAE;QACR,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,CAAC,EAAE,KAAK,CAAA;KACjB,CAAA;CACF,CAAA;AAGD,oBAAY,OAAO;IACjB,EAAE,OAAO;IACT,GAAG,QAAQ;IACX,EAAE,OAAO;IACT,GAAG,QA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CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,CAAA;AAG3G,oBAAY,IAAI,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,GAAG,QAAQ,CAAC,aAAa,GAAG,QAAQ,CAAC,aAAa,GAAG,SAAS,CAAA;AAGpH,oBAAY,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAA"}
@@ -1,3 +1,4 @@
1
1
  import { Conditions } from './types';
2
2
  export declare const appendTime: <D>(data: D, type: 'create' | 'update') => D;
3
3
  export declare const defaultConditions: Conditions;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAGpC,eAAO,MAAM,UAAU,qBAAsB,QAAQ,GAAG,QAAQ,MAQ/D,CAAA;AAGD,eAAO,MAAM,iBAAiB,EAAE,UAa/B,CAAA"}
@@ -1,3 +1,4 @@
1
- export * from './database';
2
1
  export * from './jsonFile';
3
2
  export * from './mail';
3
+ export { default as DataStore, DataStoreOptions } from 'nedb';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AAEtB,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,gBAAgB,EAAE,MAAM,MAAM,CAAA"}
@@ -1,3 +1,4 @@
1
- export * from "./database";
1
+ // export * from './database'
2
2
  export * from "./jsonFile";
3
- export * from "./mail";
3
+ export * from "./mail";
4
+ export { default as DataStore, DataStoreOptions } from 'nedb';
@@ -4,3 +4,4 @@ export declare class JsonFile {
4
4
  get(key: string): Promise<unknown>;
5
5
  set(key: string, value: any): void;
6
6
  }
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAIA,qBAAa,QAAQ;IACnB,QAAQ,EAAE,MAAM,CAAC;gBAEL,QAAQ,EAAE,MAAM;IAI5B,GAAG,CAAC,GAAG,EAAE,MAAM;IASf,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG;CAQ5B"}
@@ -1 +1,2 @@
1
1
  export declare const sendMail: (toEmail: string, title: string, content?: string) => Promise<string>;
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,QAAQ,YAAmB,MAAM,SAAS,MAAM,YAAY,MAAM,oBAY9E,CAAA"}
@@ -1,2 +1,3 @@
1
1
  export * from './common';
2
2
  export * from './node/index';
3
+ //# sourceMappingURL=node.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.d.ts","sourceRoot":"","sources":["node.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAA;AACxB,cAAc,cAAc,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wzyjs/utils",
3
- "version": "0.1.0",
3
+ "version": "0.2.2",
4
4
  "description": "description",
5
5
  "author": "wzy",
6
6
  "license": "ISC",
@@ -23,7 +23,9 @@
23
23
  ],
24
24
  "dependencies": {
25
25
  "@cloudbase/node-sdk": "^2.9.1",
26
+ "@types/nedb": "^1.8.16",
26
27
  "animejs": "^3.2.1",
28
+ "axios": "^1.6.2",
27
29
  "classnames": "^2.3.2",
28
30
  "consola": "^2.15.3",
29
31
  "copy-to-clipboard": "^3.3.3",
@@ -31,6 +33,7 @@
31
33
  "localforage": "^1.10.0",
32
34
  "lodash": "^4.17.21",
33
35
  "md5": "^2.3.0",
36
+ "nedb": "^1.8.0",
34
37
  "nodemailer": "^6.9.1",
35
38
  "tslib": "^2.4.1",
36
39
  "zod": "^3.21.4"
@@ -41,7 +44,7 @@
41
44
  "@types/md5": "^2.3.2",
42
45
  "@types/node": "^18.11.11",
43
46
  "@types/nodemailer": "^6.4.7",
44
- "@wzyjs/types": "^0.1.0",
47
+ "@wzyjs/types": "^0.2.2",
45
48
  "father": "^4.2.3",
46
49
  "typescript": "^4.9.3"
47
50
  },
@@ -52,5 +55,5 @@
52
55
  "type": "git",
53
56
  "url": "https://gitee.com/wang-zhenyu/app.git"
54
57
  },
55
- "gitHead": "3efe774801f46de9c70693ace99d01eb7fb06da1"
58
+ "gitHead": "a9e5d6f01fbca5d85b20855a3359a48ed42b67b5"
56
59
  }