@zwa73/utils 1.0.291 → 1.0.293

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,4 +1,4 @@
1
1
  import { UtilFT } from "./UtilFileTools";
2
- export declare const outcome: typeof import("@zwa73/js-utils").JsFunc.outcome, extractOutcome: typeof import("@zwa73/js-utils").JsFunc.extractOutcome, success: typeof import("@zwa73/js-utils").JsFunc.success, failed: typeof import("@zwa73/js-utils").JsFunc.failed, match: typeof import("@zwa73/js-utils").JsFunc.match, isSafeNumber: typeof import("@zwa73/js-utils").JsFunc.isSafeNumber, assertType: typeof import("@zwa73/js-utils").JsFunc.assertType, assertLiteral: typeof import("@zwa73/js-utils").JsFunc.assertLiteral, deepClone: typeof import("@zwa73/js-utils").JsFunc.deepClone, sleep: typeof import("@zwa73/js-utils").JsFunc.sleep, stringifyJToken: typeof import("@zwa73/js-utils").JsFunc.stringifyJToken, getTime: typeof import("@zwa73/js-utils").JsFunc.getTime, mapEntries: typeof import("@zwa73/js-utils").JsFunc.mapEntries, dedent: typeof import("@zwa73/js-utils").JsFunc.dedent, throwError: typeof import("@zwa73/js-utils").JsFunc.throwError, eitherize: typeof import("@zwa73/js-utils").JsFunc.eitherize, memoize: typeof import("@zwa73/js-utils").JsFunc.memoize, lazyFunction: typeof import("@zwa73/js-utils").JsFunc.lazyFunction, ivk: typeof import("@zwa73/js-utils").JsFunc.ivk, l2s: typeof import("@zwa73/js-utils").JsFunc.l2s, s2l: typeof import("@zwa73/js-utils").JsFunc.s2l, structEqual: typeof import("@zwa73/js-utils").JsFunc.structEqual, range: typeof import("@zwa73/js-utils").JsFunc.range, preset: typeof import("@zwa73/js-utils").JsFunc.preset, assignOption: typeof import("@zwa73/js-utils").JsFunc.assignOption;
2
+ export declare const outcome: typeof import("@zwa73/js-utils").JsFunc.outcome, extractOutcome: typeof import("@zwa73/js-utils").JsFunc.extractOutcome, success: typeof import("@zwa73/js-utils").JsFunc.success, failed: typeof import("@zwa73/js-utils").JsFunc.failed, match: typeof import("@zwa73/js-utils").JsFunc.match, isSafeNumber: typeof import("@zwa73/js-utils").JsFunc.isSafeNumber, checkType: typeof import("@zwa73/js-utils").JsFunc.checkType, checkLiteral: typeof import("@zwa73/js-utils").JsFunc.checkLiteral, assertType: typeof import("@zwa73/js-utils").JsFunc.assertType, deepClone: typeof import("@zwa73/js-utils").JsFunc.deepClone, sleep: typeof import("@zwa73/js-utils").JsFunc.sleep, stringifyJToken: typeof import("@zwa73/js-utils").JsFunc.stringifyJToken, getTime: typeof import("@zwa73/js-utils").JsFunc.getTime, mapEntries: typeof import("@zwa73/js-utils").JsFunc.mapEntries, dedent: typeof import("@zwa73/js-utils").JsFunc.dedent, throwError: typeof import("@zwa73/js-utils").JsFunc.throwError, eitherize: typeof import("@zwa73/js-utils").JsFunc.eitherize, memoize: typeof import("@zwa73/js-utils").JsFunc.memoize, lazyFunction: typeof import("@zwa73/js-utils").JsFunc.lazyFunction, ivk: typeof import("@zwa73/js-utils").JsFunc.ivk, l2s: typeof import("@zwa73/js-utils").JsFunc.l2s, s2l: typeof import("@zwa73/js-utils").JsFunc.s2l, structEqual: typeof import("@zwa73/js-utils").JsFunc.structEqual, range: typeof import("@zwa73/js-utils").JsFunc.range, preset: typeof import("@zwa73/js-utils").JsFunc.preset, assignOption: typeof import("@zwa73/js-utils").JsFunc.assignOption;
3
3
  export declare const stylizePath: typeof UtilFT.stylizePath, posixizePath: typeof UtilFT.posixizePath, win32izePath: typeof UtilFT.win32izePath, currosizePath: typeof UtilFT.currosizePath;
4
4
  export declare const when: <const S extends import("@zwa73/js-utils").Keyable, T, R>(stat: import("@zwa73/js-utils").Literal<S>, f: (arg: Extract<T, import("@zwa73/js-utils").Matchable<S>>) => R) => (arg: T) => (false extends (symbol extends T ? S extends T & symbol ? false : true : string extends T ? S extends T & string ? false : true : number extends T ? S extends T & number ? false : true : true) ? T | R : import("@zwa73/js-utils").MatchableFlag<T> extends S ? Exclude<T, import("@zwa73/js-utils").Matchable<S>> | R : import("@zwa73/js-utils").MatchableFlag<T> extends Exclude<S, import("@zwa73/js-utils").MatchableFlag<T>> ? T : Exclude<T, import("@zwa73/js-utils").Matchable<S>> | R), map: typeof import("@zwa73/js-utils").JsFP.map, flow: typeof import("@zwa73/js-utils").JsFP.flow, pipe: typeof import("@zwa73/js-utils").JsFP.pipe, chain: <T, R>(f: (arg: Extract<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Success>>) => R) => (arg: T) => false extends (symbol extends T ? typeof import("@zwa73/js-utils").Success extends infer T_1 ? T_1 extends typeof import("@zwa73/js-utils").Success ? T_1 extends T & symbol ? false : true : never : never : string extends T ? typeof import("@zwa73/js-utils").Success extends infer T_2 ? T_2 extends typeof import("@zwa73/js-utils").Success ? T_2 extends T & string ? false : true : never : never : number extends T ? typeof import("@zwa73/js-utils").Success extends infer T_3 ? T_3 extends typeof import("@zwa73/js-utils").Success ? T_3 extends T & number ? false : true : never : never : true) ? T | R : import("@zwa73/js-utils").MatchableFlag<T> extends typeof import("@zwa73/js-utils").Success ? R | Exclude<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Success>> : import("@zwa73/js-utils").MatchableFlag<T> extends Exclude<typeof import("@zwa73/js-utils").Success, import("@zwa73/js-utils").MatchableFlag<T>> ? T : R | Exclude<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Success>>, alt: <T, R>(f: (arg: Extract<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Failed>>) => R) => (arg: T) => false extends (symbol extends T ? typeof import("@zwa73/js-utils").Failed extends infer T_1 ? T_1 extends typeof import("@zwa73/js-utils").Failed ? T_1 extends T & symbol ? false : true : never : never : string extends T ? typeof import("@zwa73/js-utils").Failed extends infer T_2 ? T_2 extends typeof import("@zwa73/js-utils").Failed ? T_2 extends T & string ? false : true : never : never : number extends T ? typeof import("@zwa73/js-utils").Failed extends infer T_3 ? T_3 extends typeof import("@zwa73/js-utils").Failed ? T_3 extends T & number ? false : true : never : never : true) ? T | R : import("@zwa73/js-utils").MatchableFlag<T> extends typeof import("@zwa73/js-utils").Failed ? R | Exclude<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Failed>> : import("@zwa73/js-utils").MatchableFlag<T> extends Exclude<typeof import("@zwa73/js-utils").Failed, import("@zwa73/js-utils").MatchableFlag<T>> ? T : R | Exclude<T, import("@zwa73/js-utils").Matchable<typeof import("@zwa73/js-utils").Failed>>, tap: typeof import("@zwa73/js-utils").JsFP.tap, curry: typeof import("@zwa73/js-utils").JsFP.curry;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.curry = exports.tap = exports.alt = exports.chain = exports.pipe = exports.flow = exports.map = exports.when = exports.currosizePath = exports.win32izePath = exports.posixizePath = exports.stylizePath = exports.assignOption = exports.preset = exports.range = exports.structEqual = exports.s2l = exports.l2s = exports.ivk = exports.lazyFunction = exports.memoize = exports.eitherize = exports.throwError = exports.dedent = exports.mapEntries = exports.getTime = exports.stringifyJToken = exports.sleep = exports.deepClone = exports.assertLiteral = exports.assertType = exports.isSafeNumber = exports.match = exports.failed = exports.success = exports.extractOutcome = exports.outcome = void 0;
3
+ exports.curry = exports.tap = exports.alt = exports.chain = exports.pipe = exports.flow = exports.map = exports.when = exports.currosizePath = exports.win32izePath = exports.posixizePath = exports.stylizePath = exports.assignOption = exports.preset = exports.range = exports.structEqual = exports.s2l = exports.l2s = exports.ivk = exports.lazyFunction = exports.memoize = exports.eitherize = exports.throwError = exports.dedent = exports.mapEntries = exports.getTime = exports.stringifyJToken = exports.sleep = exports.deepClone = exports.assertType = exports.checkLiteral = exports.checkType = exports.isSafeNumber = exports.match = exports.failed = exports.success = exports.extractOutcome = exports.outcome = void 0;
4
4
  const UtilFileTools_1 = require("./UtilFileTools");
5
5
  const UtilFP_1 = require("./UtilFP");
6
6
  const UtilFunctions_1 = require("./UtilFunctions");
7
- exports.outcome = UtilFunctions_1.UtilFunc.outcome, exports.extractOutcome = UtilFunctions_1.UtilFunc.extractOutcome, exports.success = UtilFunctions_1.UtilFunc.success, exports.failed = UtilFunctions_1.UtilFunc.failed, exports.match = UtilFunctions_1.UtilFunc.match, exports.isSafeNumber = UtilFunctions_1.UtilFunc.isSafeNumber, exports.assertType = UtilFunctions_1.UtilFunc.assertType, exports.assertLiteral = UtilFunctions_1.UtilFunc.assertLiteral, exports.deepClone = UtilFunctions_1.UtilFunc.deepClone, exports.sleep = UtilFunctions_1.UtilFunc.sleep, exports.stringifyJToken = UtilFunctions_1.UtilFunc.stringifyJToken, exports.getTime = UtilFunctions_1.UtilFunc.getTime, exports.mapEntries = UtilFunctions_1.UtilFunc.mapEntries, exports.dedent = UtilFunctions_1.UtilFunc.dedent, exports.throwError = UtilFunctions_1.UtilFunc.throwError, exports.eitherize = UtilFunctions_1.UtilFunc.eitherize, exports.memoize = UtilFunctions_1.UtilFunc.memoize, exports.lazyFunction = UtilFunctions_1.UtilFunc.lazyFunction, exports.ivk = UtilFunctions_1.UtilFunc.ivk, exports.l2s = UtilFunctions_1.UtilFunc.l2s, exports.s2l = UtilFunctions_1.UtilFunc.s2l, exports.structEqual = UtilFunctions_1.UtilFunc.structEqual, exports.range = UtilFunctions_1.UtilFunc.range, exports.preset = UtilFunctions_1.UtilFunc.preset, exports.assignOption = UtilFunctions_1.UtilFunc.assignOption;
7
+ exports.outcome = UtilFunctions_1.UtilFunc.outcome, exports.extractOutcome = UtilFunctions_1.UtilFunc.extractOutcome, exports.success = UtilFunctions_1.UtilFunc.success, exports.failed = UtilFunctions_1.UtilFunc.failed, exports.match = UtilFunctions_1.UtilFunc.match, exports.isSafeNumber = UtilFunctions_1.UtilFunc.isSafeNumber, exports.checkType = UtilFunctions_1.UtilFunc.checkType, exports.checkLiteral = UtilFunctions_1.UtilFunc.checkLiteral, exports.assertType = UtilFunctions_1.UtilFunc.assertType, exports.deepClone = UtilFunctions_1.UtilFunc.deepClone, exports.sleep = UtilFunctions_1.UtilFunc.sleep, exports.stringifyJToken = UtilFunctions_1.UtilFunc.stringifyJToken, exports.getTime = UtilFunctions_1.UtilFunc.getTime, exports.mapEntries = UtilFunctions_1.UtilFunc.mapEntries, exports.dedent = UtilFunctions_1.UtilFunc.dedent, exports.throwError = UtilFunctions_1.UtilFunc.throwError, exports.eitherize = UtilFunctions_1.UtilFunc.eitherize, exports.memoize = UtilFunctions_1.UtilFunc.memoize, exports.lazyFunction = UtilFunctions_1.UtilFunc.lazyFunction, exports.ivk = UtilFunctions_1.UtilFunc.ivk, exports.l2s = UtilFunctions_1.UtilFunc.l2s, exports.s2l = UtilFunctions_1.UtilFunc.s2l, exports.structEqual = UtilFunctions_1.UtilFunc.structEqual, exports.range = UtilFunctions_1.UtilFunc.range, exports.preset = UtilFunctions_1.UtilFunc.preset, exports.assignOption = UtilFunctions_1.UtilFunc.assignOption;
8
8
  exports.stylizePath = UtilFileTools_1.UtilFT.stylizePath, exports.posixizePath = UtilFileTools_1.UtilFT.posixizePath, exports.win32izePath = UtilFileTools_1.UtilFT.win32izePath, exports.currosizePath = UtilFileTools_1.UtilFT.currosizePath;
9
9
  exports.when = UtilFP_1.UtilFP.when, exports.map = UtilFP_1.UtilFP.map, exports.flow = UtilFP_1.UtilFP.flow, exports.pipe = UtilFP_1.UtilFP.pipe, exports.chain = UtilFP_1.UtilFP.chain, exports.alt = UtilFP_1.UtilFP.alt, exports.tap = UtilFP_1.UtilFP.tap, exports.curry = UtilFP_1.UtilFP.curry;
10
10
  if (false) {
11
- //let aaser = assertLiteral({a:1});
11
+ //let aaser = checkLiteral({a:1});
12
12
  //let a:"asd"|"dsa" = null as any;
13
13
  //const r = matchProc(a,{
14
14
  // "asd":(a)=>"ssa" as const,
@@ -57,6 +57,6 @@ declare class _UtilFunc {
57
57
  */
58
58
  static resolveDataStore<T>(source: ParseableDataStore<T>): DataStore<T>;
59
59
  }
60
- export declare const UtilFunc: import("@zwa73/modular-mixer").ComposedClass<typeof _UtilFunc, typeof JsFunc, "__jsUtils", "prototype" | "preset" | "assignOption" | "genUUID" | "getTime" | "initField" | "initObject" | "afterward" | "sleep" | "getNeverResolvedPromise" | "retryPromise" | "timelimitPromise" | "mapEntries" | "eachField" | "stringifyJToken" | "sortJToken" | "assertType" | "assertLiteral" | "deepClone" | "isSafeNumber" | "dedent" | "throwError" | "getStack" | "getFuncLoc" | "cachePool" | "memoize" | "asyncize" | "lazyFunction" | "iocify" | "splitToChunk" | "mergeFromChunk" | "structEqual" | "concurrent" | "dynamicImport" | "createInjectable" | "createAsyncProxy" | "checkSharpSchema" | "unwarpReadonly" | "outcome" | "extractOutcome" | "success" | "failed" | "match" | "isStatus" | "eitherize" | "parseSrtTime" | "formatSrtTime" | "parseSrt" | "createSrt" | "ivk" | "range" | "s2l" | "l2s">;
60
+ export declare const UtilFunc: import("@zwa73/modular-mixer").ComposedClass<typeof _UtilFunc, typeof JsFunc, "__jsUtils", "prototype" | "preset" | "assignOption" | "genUUID" | "getTime" | "initField" | "initObject" | "afterward" | "sleep" | "getNeverResolvedPromise" | "retryPromise" | "timelimitPromise" | "mapEntries" | "eachField" | "stringifyJToken" | "sortJToken" | "checkType" | "checkLiteral" | "assertType" | "deepClone" | "isSafeNumber" | "dedent" | "throwError" | "getStack" | "getFuncLoc" | "cachePool" | "memoize" | "asyncize" | "lazyFunction" | "iocify" | "splitToChunk" | "mergeFromChunk" | "structEqual" | "concurrent" | "dynamicImport" | "createInjectable" | "createAsyncProxy" | "checkSharpSchema" | "unwarpReadonly" | "outcome" | "extractOutcome" | "success" | "failed" | "match" | "isStatus" | "eitherize" | "parseSrtTime" | "formatSrtTime" | "parseSrt" | "createSrt" | "ivk" | "range" | "s2l" | "l2s">;
61
61
  export type UtilFunc = typeof UtilFunc;
62
62
  export {};
@@ -113,8 +113,6 @@ export declare class UtilHttp<D extends Partial<RequestOption> & Required<Pick<R
113
113
  header<HAD extends http.OutgoingHttpHeaders>(headers: HAD): UtilHttp<D & {
114
114
  headers: HAD;
115
115
  }, S, A>;
116
- /**设置agent */
117
- proxyAgent(url: string): this;
118
116
  /**添加一段query */
119
117
  query(data: QueryRequestData): this;
120
118
  /**克隆 */
package/dist/UtilHttp.js CHANGED
@@ -11,8 +11,6 @@ const querystring_1 = __importDefault(require("querystring"));
11
11
  const url_1 = require("url");
12
12
  const js_utils_1 = require("@zwa73/js-utils");
13
13
  const form_data_1 = __importDefault(require("form-data"));
14
- const http_proxy_agent_1 = require("http-proxy-agent");
15
- const https_proxy_agent_1 = require("https-proxy-agent");
16
14
  const pathe_1 = __importDefault(require("pathe"));
17
15
  const UtilFunctions_1 = require("./UtilFunctions");
18
16
  const UtilLogger_1 = require("./UtilLogger");
@@ -101,14 +99,6 @@ class UtilHttp {
101
99
  };
102
100
  return this;
103
101
  }
104
- /**设置agent */
105
- proxyAgent(url) {
106
- this._data.agent = UtilFunctions_1.UtilFunc.match(this._data['protocol'], {
107
- 'http:': () => new http_proxy_agent_1.HttpProxyAgent(url),
108
- 'https:': () => new https_proxy_agent_1.HttpsProxyAgent(url),
109
- });
110
- return this;
111
- }
112
102
  /**添加一段query */
113
103
  query(data) {
114
104
  this._data.path = UtilHttp.buildQuery(this._data.path ?? '', data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zwa73/utils",
3
- "version": "1.0.291",
3
+ "version": "1.0.293",
4
4
  "description": "my utils",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -21,8 +21,6 @@
21
21
  "form-data": "^4.0.2",
22
22
  "glob": "^13.0.0",
23
23
  "html-entities": "^2.3.3",
24
- "http-proxy-agent": "^7.0.2",
25
- "https-proxy-agent": "^7.0.6",
26
24
  "pathe": "^1.1.2",
27
25
  "querystring": "^0.2.1",
28
26
  "winston": "^3.10.0",