@wzyjs/utils 0.2.55 → 0.2.57

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,2 +1 @@
1
1
  export declare const readClipboard: () => Promise<string>;
2
- export declare const printConsoleLog: (type: string, path: string, params: any, response: any) => void;
@@ -10359,6 +10359,7 @@ __export(exports_browser, {
10359
10359
  isAborted: () => isAborted,
10360
10360
  intersection: () => intersectionType,
10361
10361
  instanceof: () => instanceOfType,
10362
+ initChinaDayjs: () => initChinaDayjs,
10362
10363
  imageToBase64: () => imageToBase64,
10363
10364
  hexToRgba: () => hexToRgba2,
10364
10365
  getType: () => getType,
@@ -19334,6 +19335,21 @@ var performDecimalOperation = (num1, num2, operator) => {
19334
19335
  return NaN;
19335
19336
  }
19336
19337
  };
19338
+ var printConsoleLog = (type, path, params, response) => {
19339
+ const styles = {
19340
+ header: "color: #fff; background: #35495e; padding: 2px 8px; border-radius: 3px 0 0 3px;",
19341
+ value: "color: #35495e; background: #f0f4f8; padding: 2px 6px; border-radius: 0 3px 3px 0;",
19342
+ separator: "color: #409EFF; margin: 0 4px;"
19343
+ };
19344
+ console.groupCollapsed(`666 %c${type}%c${path}`, styles.header, styles.value);
19345
+ if (params) {
19346
+ console.table(params);
19347
+ }
19348
+ if (response) {
19349
+ console.table(response);
19350
+ }
19351
+ console.groupEnd();
19352
+ };
19337
19353
  // src/common/number.ts
19338
19354
  var getRandomNum = (min2, max2) => {
19339
19355
  return Math.floor(Math.random() * (max2 - min2 + 1) + min2);
@@ -19461,15 +19477,22 @@ import_dayjs.default.extend(import_updateLocale.default);
19461
19477
  import_dayjs.default.extend(import_timezone.default);
19462
19478
  import_dayjs.default.extend(import_isSameOrAfter.default);
19463
19479
  import_dayjs.default.extend(import_isSameOrBefore.default);
19464
- import_dayjs.default.locale("zh-cn");
19465
- import_dayjs.default.tz.setDefault("Asia/Shanghai");
19466
- import_dayjs.default.updateLocale("zh-cn", {
19467
- weekStart: 1
19468
- });
19469
19480
  var Timezone;
19470
19481
  ((Timezone2) => {
19471
19482
  Timezone2["AsiaShanghai"] = "Asia/Shanghai";
19483
+ Timezone2["AsiaTokyo"] = "Asia/Tokyo";
19484
+ Timezone2["AmericaNewYork"] = "America/New_York";
19485
+ Timezone2["EuropeLondon"] = "Europe/London";
19486
+ Timezone2["EuropeBerlin"] = "Europe/Berlin";
19472
19487
  })(Timezone ||= {});
19488
+ var initChinaDayjs = () => {
19489
+ import_dayjs.default.locale("zh-cn");
19490
+ import_dayjs.default.tz.setDefault("Asia/Shanghai" /* AsiaShanghai */);
19491
+ import_dayjs.default.updateLocale("zh-cn", {
19492
+ weekStart: 1
19493
+ });
19494
+ return import_dayjs.default;
19495
+ };
19473
19496
  var dayjs_default = import_dayjs.default;
19474
19497
  // src/browser/index.ts
19475
19498
  var import_md5 = __toESM(require_md5());
@@ -20949,21 +20972,6 @@ var readClipboard = async () => {
20949
20972
  return "";
20950
20973
  }
20951
20974
  };
20952
- var printConsoleLog = (type, path, params, response) => {
20953
- const styles = {
20954
- header: "color: #fff; background: #35495e; padding: 2px 8px; border-radius: 3px 0 0 3px;",
20955
- value: "color: #35495e; background: #f0f4f8; padding: 2px 6px; border-radius: 0 3px 3px 0;",
20956
- separator: "color: #409EFF; margin: 0 4px;"
20957
- };
20958
- console.groupCollapsed(`666 %c${type}%c${path}`, styles.header, styles.value);
20959
- if (params) {
20960
- console.table(params);
20961
- }
20962
- if (response) {
20963
- console.table(response);
20964
- }
20965
- console.groupEnd();
20966
- };
20967
20975
  // src/browser/location.ts
20968
20976
  var import_lodash2 = __toESM(require_lodash());
20969
20977
  var url2Params = (url = location.href) => {
@@ -19152,6 +19152,21 @@ var performDecimalOperation = (num1, num2, operator) => {
19152
19152
  return NaN;
19153
19153
  }
19154
19154
  };
19155
+ var printConsoleLog = (type, path, params, response) => {
19156
+ const styles = {
19157
+ header: "color: #fff; background: #35495e; padding: 2px 8px; border-radius: 3px 0 0 3px;",
19158
+ value: "color: #35495e; background: #f0f4f8; padding: 2px 6px; border-radius: 0 3px 3px 0;",
19159
+ separator: "color: #409EFF; margin: 0 4px;"
19160
+ };
19161
+ console.groupCollapsed(`666 %c${type}%c${path}`, styles.header, styles.value);
19162
+ if (params) {
19163
+ console.table(params);
19164
+ }
19165
+ if (response) {
19166
+ console.table(response);
19167
+ }
19168
+ console.groupEnd();
19169
+ };
19155
19170
  // src/common/number.ts
19156
19171
  var getRandomNum = (min2, max2) => {
19157
19172
  return Math.floor(Math.random() * (max2 - min2 + 1) + min2);
@@ -19279,15 +19294,22 @@ import_dayjs.default.extend(import_updateLocale.default);
19279
19294
  import_dayjs.default.extend(import_timezone.default);
19280
19295
  import_dayjs.default.extend(import_isSameOrAfter.default);
19281
19296
  import_dayjs.default.extend(import_isSameOrBefore.default);
19282
- import_dayjs.default.locale("zh-cn");
19283
- import_dayjs.default.tz.setDefault("Asia/Shanghai");
19284
- import_dayjs.default.updateLocale("zh-cn", {
19285
- weekStart: 1
19286
- });
19287
19297
  var Timezone;
19288
19298
  ((Timezone2) => {
19289
19299
  Timezone2["AsiaShanghai"] = "Asia/Shanghai";
19300
+ Timezone2["AsiaTokyo"] = "Asia/Tokyo";
19301
+ Timezone2["AmericaNewYork"] = "America/New_York";
19302
+ Timezone2["EuropeLondon"] = "Europe/London";
19303
+ Timezone2["EuropeBerlin"] = "Europe/Berlin";
19290
19304
  })(Timezone ||= {});
19305
+ var initChinaDayjs = () => {
19306
+ import_dayjs.default.locale("zh-cn");
19307
+ import_dayjs.default.tz.setDefault("Asia/Shanghai" /* AsiaShanghai */);
19308
+ import_dayjs.default.updateLocale("zh-cn", {
19309
+ weekStart: 1
19310
+ });
19311
+ return import_dayjs.default;
19312
+ };
19291
19313
  var dayjs_default = import_dayjs.default;
19292
19314
  // src/browser/index.ts
19293
19315
  var import_md5 = __toESM(require_md5(), 1);
@@ -20767,21 +20789,6 @@ var readClipboard = async () => {
20767
20789
  return "";
20768
20790
  }
20769
20791
  };
20770
- var printConsoleLog = (type, path, params, response) => {
20771
- const styles = {
20772
- header: "color: #fff; background: #35495e; padding: 2px 8px; border-radius: 3px 0 0 3px;",
20773
- value: "color: #35495e; background: #f0f4f8; padding: 2px 6px; border-radius: 0 3px 3px 0;",
20774
- separator: "color: #409EFF; margin: 0 4px;"
20775
- };
20776
- console.groupCollapsed(`666 %c${type}%c${path}`, styles.header, styles.value);
20777
- if (params) {
20778
- console.table(params);
20779
- }
20780
- if (response) {
20781
- console.table(response);
20782
- }
20783
- console.groupEnd();
20784
- };
20785
20792
  // src/browser/location.ts
20786
20793
  var import_lodash2 = __toESM(require_lodash(), 1);
20787
20794
  var url2Params = (url = location.href) => {
@@ -20903,6 +20910,7 @@ export {
20903
20910
  isAborted,
20904
20911
  intersectionType as intersection,
20905
20912
  instanceOfType as instanceof,
20913
+ initChinaDayjs,
20906
20914
  imageToBase64,
20907
20915
  hexToRgba2 as hexToRgba,
20908
20916
  getType,
@@ -6,8 +6,13 @@ import isSameOrAfter from 'dayjs/plugin/isSameOrAfter';
6
6
  import isSameOrBefore from 'dayjs/plugin/isSameOrBefore';
7
7
  import 'dayjs/locale/zh-cn';
8
8
  export declare enum Timezone {
9
- AsiaShanghai = "Asia/Shanghai"
9
+ AsiaShanghai = "Asia/Shanghai",
10
+ AsiaTokyo = "Asia/Tokyo",
11
+ AmericaNewYork = "America/New_York",
12
+ EuropeLondon = "Europe/London",
13
+ EuropeBerlin = "Europe/Berlin"
10
14
  }
15
+ export declare const initChinaDayjs: () => typeof dayjs;
11
16
  export { Dayjs } from 'dayjs';
12
17
  declare const _default: typeof dayjs & {
13
18
  isBetween: typeof isBetween;
@@ -9,4 +9,4 @@ export * from './other';
9
9
  export * from './number';
10
10
  export * from './array';
11
11
  export * from './image';
12
- export { default as dayjs, Dayjs, Timezone } from './dayjs';
12
+ export { default as dayjs, Dayjs, Timezone, initChinaDayjs } from './dayjs';
@@ -2,3 +2,4 @@ export declare const delay: (time?: number) => Promise<unknown>;
2
2
  export declare const calcJsText: (expr: string, context: Record<string, any>) => any;
3
3
  export declare const optionsToEnum: (options: any[], text: string, key: string) => any;
4
4
  export declare const performDecimalOperation: (num1?: number, num2?: number, operator?: string) => number | undefined;
5
+ export declare const printConsoleLog: (type: string, path: string, params: any, response: any) => void;
@@ -0,0 +1,2 @@
1
+ export declare const interval: (intervalMinutes: number, immediately: boolean, fn: () => (void | Promise<void>)) => void;
2
+ export declare const schedule: (cronExpression: string, immediately: boolean, fn: () => (void | Promise<void>)) => void;
@@ -1,5 +1,6 @@
1
1
  export * from './mail';
2
2
  export * from './file';
3
3
  export * from './oss';
4
+ export * from './cron';
4
5
  export { default as DataStore, DataStoreOptions } from 'nedb';
5
6
  export * as cheerio from 'cheerio';