@zwa73/utils 1.0.264 → 1.0.265
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.
- package/dist/UtilFunctions.d.ts +1 -1
- package/dist/UtilFunctions.js +4 -0
- package/package.json +1 -1
package/dist/UtilFunctions.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ declare class _UtilFunc {
|
|
|
45
45
|
/**获取当前公网ipv4
|
|
46
46
|
* 依赖于 public-ip@6.0.2 但不会自动安装
|
|
47
47
|
*/
|
|
48
|
-
static getPublicIpv4(): Promise<string>;
|
|
48
|
+
static getPublicIpv4(): Promise<string | undefined>;
|
|
49
49
|
}
|
|
50
50
|
export declare const UtilFunc: import("@zwa73/modular-mixer").ComposedClass<typeof _UtilFunc, typeof JsFunc, "__jsUtils", "match" | "failed" | "success" | "prototype" | "genUUID" | "range" | "preset" | "assignOption" | "getTime" | "initField" | "initObject" | "afterward" | "sleep" | "getNeverResolvedPromise" | "retryPromise" | "timelimitPromise" | "mapEntries" | "eachField" | "stringifyJToken" | "sortJToken" | "assertType" | "assertLiteral" | "deepClone" | "isSafeNumber" | "dedent" | "throwError" | "getFuncLoc" | "cachePool" | "memoize" | "asyncize" | "lazyFunction" | "splitToChunk" | "mergeFromChunk" | "structEqual" | "concurrent" | "dynamicImport" | "createInjectable" | "createAsyncProxy" | "checkSharpSchema" | "outcome" | "extractOutcome" | "isStatus" | "eitherize" | "parseSrtTime" | "formatSrtTime" | "parseSrt" | "createSrt" | "ivk" | "s2l" | "l2s">;
|
|
51
51
|
export type UtilFunc = typeof UtilFunc;
|
package/dist/UtilFunctions.js
CHANGED
|
@@ -123,6 +123,10 @@ class _UtilFunc {
|
|
|
123
123
|
const pip = await js_utils_1.JsFunc.dynamicImport('public-ip');
|
|
124
124
|
//if(_UtilFunc.publicIp===undefined)
|
|
125
125
|
// _UtilFunc.publicIp = await import("public-ip");
|
|
126
|
+
if (pip == undefined) {
|
|
127
|
+
UtilLogger_1.SLogger.warn(`npm包 public-ip 动态导入失败, 可能是未安装, 可使用 npm i public-ip@6.0.2 来安装`);
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
126
130
|
return pip.publicIpv4();
|
|
127
131
|
}
|
|
128
132
|
}
|