@domain.js/main 0.4.8 → 0.4.9

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.
@@ -64,9 +64,9 @@ export declare const tryCatchLog: TryCatchLogFn;
64
64
  * @returns true or false
65
65
  */
66
66
  export declare const inExpired: (time: number, life: number) => boolean;
67
- declare type Params = {
67
+ interface Params {
68
68
  [K: string]: string;
69
- };
69
+ }
70
70
  /**
71
71
  * Modify a URL address, add some attributes and delete some attributes
72
72
  * @param address URL address
@@ -74,6 +74,11 @@ declare type Params = {
74
74
  * @param removes The string list will be remove from address
75
75
  * @returns Modified address
76
76
  */
77
+ export declare const modifyURL: (address: string, adds?: Params | undefined, removes?: string[] | undefined) => string;
78
+ /**
79
+ * @deprecated
80
+ * alias modifyURL
81
+ */
77
82
  export declare const modifiyURL: (address: string, adds?: Params | undefined, removes?: string[] | undefined) => string;
78
83
  /**
79
84
  * 等待,知道 test 返回 true
@@ -22,7 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
22
22
  return (mod && mod.__esModule) ? mod : { "default": mod };
23
23
  };
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
- exports.deepReaddir = exports.waitFor = exports.modifiyURL = exports.inExpired = exports.tryCatchLog = exports.deepFreeze = exports.sleep = exports.lcfirst = exports.ucfirst = exports.nt2space = exports.randStr = exports.md5 = void 0;
25
+ exports.deepReaddir = exports.waitFor = exports.modifiyURL = exports.modifyURL = exports.inExpired = exports.tryCatchLog = exports.deepFreeze = exports.sleep = exports.lcfirst = exports.ucfirst = exports.nt2space = exports.randStr = exports.md5 = void 0;
26
26
  const async_1 = __importDefault(require("async"));
27
27
  const crypto = __importStar(require("crypto"));
28
28
  const fs_1 = __importDefault(require("fs"));
@@ -138,7 +138,7 @@ exports.inExpired = inExpired;
138
138
  * @param removes The string list will be remove from address
139
139
  * @returns Modified address
140
140
  */
141
- const modifiyURL = (address, adds, removes) => {
141
+ const modifyURL = (address, adds, removes) => {
142
142
  const obj = new URL(address);
143
143
  if (typeof adds === "object") {
144
144
  for (const key of Object.keys(adds)) {
@@ -151,7 +151,12 @@ const modifiyURL = (address, adds, removes) => {
151
151
  }
152
152
  return obj.toString();
153
153
  };
154
- exports.modifiyURL = modifiyURL;
154
+ exports.modifyURL = modifyURL;
155
+ /**
156
+ * @deprecated
157
+ * alias modifyURL
158
+ */
159
+ exports.modifiyURL = exports.modifyURL;
155
160
  /**
156
161
  * 等待,知道 test 返回 true
157
162
  * @param test 检测函数
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domain.js/main",
3
- "version": "0.4.8",
3
+ "version": "0.4.9",
4
4
  "description": "DDD framework",
5
5
  "main": "dist/index.js",
6
6
  "bin": {