@wzyjs/utils 0.2.40 → 0.2.42

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 * from './chat';
2
- export * as image from './image';
@@ -1,3 +1 @@
1
- export * as keling from './keling';
2
1
  export * as ai302 from './302';
3
- export * as midjourney from './midjourney';
@@ -6,3 +6,4 @@ export { default as localforage } from 'localforage';
6
6
  export * from './style';
7
7
  export * from './element';
8
8
  export * from './other';
9
+ export * from './location';
@@ -0,0 +1,8 @@
1
+ export declare const url2Params: (url?: string) => {
2
+ [key: string]: string;
3
+ };
4
+ export declare const params2Url: (params: {
5
+ [key: string]: any;
6
+ }) => string;
7
+ export declare const setUrlParams: (key: string, value: any, keepName: string) => void;
8
+ export declare const urlGetPath: (url?: string) => string;
@@ -10406,7 +10406,7 @@ __export(exports_browser, {
10406
10406
  anime: () => anime_es_default,
10407
10407
  amount: () => amount,
10408
10408
  addIssueToContext: () => addIssueToContext,
10409
- _: () => import_lodash2.default,
10409
+ _: () => import_lodash.default,
10410
10410
  ZodVoid: () => ZodVoid,
10411
10411
  ZodUnknown: () => ZodUnknown,
10412
10412
  ZodUnion: () => ZodUnion,
@@ -10464,7 +10464,7 @@ __export(exports_browser, {
10464
10464
  module.exports = __toCommonJS(exports_browser);
10465
10465
 
10466
10466
  // src/common/index.ts
10467
- var import_lodash2 = __toESM(require_lodash());
10467
+ var import_lodash = __toESM(require_lodash());
10468
10468
 
10469
10469
  // ../../node_modules/axios/lib/helpers/bind.js
10470
10470
  function bind(fn, thisArg) {
@@ -19439,50 +19439,6 @@ async function imageToBase64(url) {
19439
19439
  throw error;
19440
19440
  }
19441
19441
  }
19442
- // src/common/location.ts
19443
- var import_lodash = __toESM(require_lodash());
19444
- var url2Params = (url = location.href) => {
19445
- url = decodeURIComponent(url);
19446
- let jsonList = {};
19447
- if (url.indexOf("?") > -1) {
19448
- let str = url.slice(url.indexOf("?") + 1);
19449
- let strs = str.split("&");
19450
- for (let i = 0;i < strs.length; i++) {
19451
- jsonList[strs[i].split("=")[0]] = strs[i].split("=")[1];
19452
- }
19453
- }
19454
- return jsonList || {};
19455
- };
19456
- var params2Url = (params) => {
19457
- let url = "";
19458
- for (let k in params) {
19459
- if (k) {
19460
- url += `${k}=${params[k]}&`;
19461
- }
19462
- }
19463
- return url.substr(0, url.length - 1);
19464
- };
19465
- var setUrlParams = (key, value, keepName) => {
19466
- if (key === undefined || value === undefined)
19467
- return;
19468
- let allParams = url2Params();
19469
- if (keepName) {
19470
- allParams = import_lodash.pick(allParams, keepName) || {};
19471
- }
19472
- allParams[key] = encodeURIComponent(value);
19473
- const url = location.href;
19474
- const sliceEnd = url.indexOf("?") === -1 ? url.length : url.indexOf("?");
19475
- const domainPath = url.slice(0, sliceEnd);
19476
- const params = params2Url(allParams);
19477
- location.replace(`${domainPath}?${params}`);
19478
- };
19479
- var urlGetPath = (url = location.href) => {
19480
- let lastIndex = url.indexOf("?");
19481
- if (lastIndex === -1) {
19482
- lastIndex = url.length;
19483
- }
19484
- return url.slice(0, lastIndex);
19485
- };
19486
19442
  // src/common/dayjs.ts
19487
19443
  var import_dayjs = __toESM(require_dayjs_min());
19488
19444
  var import_isBetween = __toESM(require_isBetween());
@@ -21008,3 +20964,47 @@ var printConsoleLog = (type, path, params, response) => {
21008
20964
  }
21009
20965
  console.groupEnd();
21010
20966
  };
20967
+ // src/browser/location.ts
20968
+ var import_lodash2 = __toESM(require_lodash());
20969
+ var url2Params = (url = location.href) => {
20970
+ url = decodeURIComponent(url);
20971
+ let jsonList = {};
20972
+ if (url.indexOf("?") > -1) {
20973
+ let str = url.slice(url.indexOf("?") + 1);
20974
+ let strs = str.split("&");
20975
+ for (let i = 0;i < strs.length; i++) {
20976
+ jsonList[strs[i].split("=")[0]] = strs[i].split("=")[1];
20977
+ }
20978
+ }
20979
+ return jsonList || {};
20980
+ };
20981
+ var params2Url = (params) => {
20982
+ let url = "";
20983
+ for (let k in params) {
20984
+ if (k) {
20985
+ url += `${k}=${params[k]}&`;
20986
+ }
20987
+ }
20988
+ return url.substr(0, url.length - 1);
20989
+ };
20990
+ var setUrlParams = (key, value, keepName) => {
20991
+ if (key === undefined || value === undefined)
20992
+ return;
20993
+ let allParams = url2Params();
20994
+ if (keepName) {
20995
+ allParams = import_lodash2.pick(allParams, keepName) || {};
20996
+ }
20997
+ allParams[key] = encodeURIComponent(value);
20998
+ const url = location.href;
20999
+ const sliceEnd = url.indexOf("?") === -1 ? url.length : url.indexOf("?");
21000
+ const domainPath = url.slice(0, sliceEnd);
21001
+ const params = params2Url(allParams);
21002
+ location.replace(`${domainPath}?${params}`);
21003
+ };
21004
+ var urlGetPath = (url = location.href) => {
21005
+ let lastIndex = url.indexOf("?");
21006
+ if (lastIndex === -1) {
21007
+ lastIndex = url.length;
21008
+ }
21009
+ return url.slice(0, lastIndex);
21010
+ };
@@ -10282,7 +10282,7 @@ var require_localforage = __commonJS((exports, module) => {
10282
10282
  });
10283
10283
 
10284
10284
  // src/common/index.ts
10285
- var import_lodash2 = __toESM(require_lodash(), 1);
10285
+ var import_lodash = __toESM(require_lodash(), 1);
10286
10286
 
10287
10287
  // ../../node_modules/axios/lib/helpers/bind.js
10288
10288
  function bind(fn, thisArg) {
@@ -19257,50 +19257,6 @@ async function imageToBase64(url) {
19257
19257
  throw error;
19258
19258
  }
19259
19259
  }
19260
- // src/common/location.ts
19261
- var import_lodash = __toESM(require_lodash(), 1);
19262
- var url2Params = (url = location.href) => {
19263
- url = decodeURIComponent(url);
19264
- let jsonList = {};
19265
- if (url.indexOf("?") > -1) {
19266
- let str = url.slice(url.indexOf("?") + 1);
19267
- let strs = str.split("&");
19268
- for (let i = 0;i < strs.length; i++) {
19269
- jsonList[strs[i].split("=")[0]] = strs[i].split("=")[1];
19270
- }
19271
- }
19272
- return jsonList || {};
19273
- };
19274
- var params2Url = (params) => {
19275
- let url = "";
19276
- for (let k in params) {
19277
- if (k) {
19278
- url += `${k}=${params[k]}&`;
19279
- }
19280
- }
19281
- return url.substr(0, url.length - 1);
19282
- };
19283
- var setUrlParams = (key, value, keepName) => {
19284
- if (key === undefined || value === undefined)
19285
- return;
19286
- let allParams = url2Params();
19287
- if (keepName) {
19288
- allParams = import_lodash.pick(allParams, keepName) || {};
19289
- }
19290
- allParams[key] = encodeURIComponent(value);
19291
- const url = location.href;
19292
- const sliceEnd = url.indexOf("?") === -1 ? url.length : url.indexOf("?");
19293
- const domainPath = url.slice(0, sliceEnd);
19294
- const params = params2Url(allParams);
19295
- location.replace(`${domainPath}?${params}`);
19296
- };
19297
- var urlGetPath = (url = location.href) => {
19298
- let lastIndex = url.indexOf("?");
19299
- if (lastIndex === -1) {
19300
- lastIndex = url.length;
19301
- }
19302
- return url.slice(0, lastIndex);
19303
- };
19304
19260
  // src/common/dayjs.ts
19305
19261
  var import_dayjs = __toESM(require_dayjs_min(), 1);
19306
19262
  var import_isBetween = __toESM(require_isBetween(), 1);
@@ -20826,13 +20782,57 @@ var printConsoleLog = (type, path, params, response) => {
20826
20782
  }
20827
20783
  console.groupEnd();
20828
20784
  };
20785
+ // src/browser/location.ts
20786
+ var import_lodash2 = __toESM(require_lodash(), 1);
20787
+ var url2Params = (url = location.href) => {
20788
+ url = decodeURIComponent(url);
20789
+ let jsonList = {};
20790
+ if (url.indexOf("?") > -1) {
20791
+ let str = url.slice(url.indexOf("?") + 1);
20792
+ let strs = str.split("&");
20793
+ for (let i = 0;i < strs.length; i++) {
20794
+ jsonList[strs[i].split("=")[0]] = strs[i].split("=")[1];
20795
+ }
20796
+ }
20797
+ return jsonList || {};
20798
+ };
20799
+ var params2Url = (params) => {
20800
+ let url = "";
20801
+ for (let k in params) {
20802
+ if (k) {
20803
+ url += `${k}=${params[k]}&`;
20804
+ }
20805
+ }
20806
+ return url.substr(0, url.length - 1);
20807
+ };
20808
+ var setUrlParams = (key, value, keepName) => {
20809
+ if (key === undefined || value === undefined)
20810
+ return;
20811
+ let allParams = url2Params();
20812
+ if (keepName) {
20813
+ allParams = import_lodash2.pick(allParams, keepName) || {};
20814
+ }
20815
+ allParams[key] = encodeURIComponent(value);
20816
+ const url = location.href;
20817
+ const sliceEnd = url.indexOf("?") === -1 ? url.length : url.indexOf("?");
20818
+ const domainPath = url.slice(0, sliceEnd);
20819
+ const params = params2Url(allParams);
20820
+ location.replace(`${domainPath}?${params}`);
20821
+ };
20822
+ var urlGetPath = (url = location.href) => {
20823
+ let lastIndex = url.indexOf("?");
20824
+ if (lastIndex === -1) {
20825
+ lastIndex = url.length;
20826
+ }
20827
+ return url.slice(0, lastIndex);
20828
+ };
20829
20829
  var export_md5 = import_md5.default;
20830
20830
  var export_localforage = import_localforage.default;
20831
20831
  var export_json5 = import_json5.default;
20832
20832
  var export_copy = import_copy_to_clipboard.default;
20833
20833
  var export_consola = import_consola.default;
20834
20834
  var export_classnames = import_classnames.default;
20835
- var export__ = import_lodash2.default;
20835
+ var export__ = import_lodash.default;
20836
20836
  var export_Dayjs = import_dayjs2.Dayjs;
20837
20837
 
20838
20838
  export {
@@ -9,5 +9,4 @@ export * from './other';
9
9
  export * from './number';
10
10
  export * from './array';
11
11
  export * from './image';
12
- export * from './location';
13
12
  export { default as dayjs, Dayjs, Timezone } from './dayjs';
@@ -2,3 +2,4 @@ export * from './mail';
2
2
  export * from './file';
3
3
  export * from './oss';
4
4
  export { default as DataStore, DataStoreOptions } from 'nedb';
5
+ export * as cheerio from 'cheerio';
@@ -1 +1,6 @@
1
- export declare const sendMail: (toEmail: string, title: string, content?: string) => Promise<string>;
1
+ export declare const sendMail: (config: {
2
+ to: string;
3
+ subject: string;
4
+ text?: string;
5
+ html?: string;
6
+ }) => Promise<import("nodemailer/lib/smtp-transport").SentMessageInfo>;