@zwa73/utils 1.0.118 → 1.0.119
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/QuickFunction.d.ts +1 -1
- package/dist/QuickFunction.js +2 -2
- package/dist/UtilFileTools.d.ts +10 -0
- package/dist/UtilFileTools.js +16 -0
- package/package.json +1 -1
- package/src/QuickFunction.ts +3 -1
- package/src/UtilFileTools.ts +17 -0
package/dist/QuickFunction.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { UtilFT } from "./UtilFileTools";
|
|
2
2
|
import { UtilFunc } from "./UtilFunctions";
|
|
3
3
|
export declare const outcome: typeof UtilFunc.outcome, matchProc: typeof UtilFunc.matchProc, sucesProc: typeof UtilFunc.sucesProc, isFailed: typeof UtilFunc.isFailed, isSafeNumber: typeof UtilFunc.isSafeNumber, isSuccess: typeof UtilFunc.isSuccess, likeNone: typeof UtilFunc.likeNone, expect: typeof UtilFunc.expect, assertType: typeof UtilFunc.assertType, assertLiteral: typeof UtilFunc.assertLiteral, deepClone: typeof UtilFunc.deepClone, sleep: typeof UtilFunc.sleep, stringifyJToken: typeof UtilFunc.stringifyJToken, getTime: typeof UtilFunc.getTime, mapEntries: typeof UtilFunc.mapEntries, dedent: typeof UtilFunc.dedent, throwError: typeof UtilFunc.throwError;
|
|
4
|
-
export declare const stylizePath: typeof UtilFT.stylizePath;
|
|
4
|
+
export declare const stylizePath: typeof UtilFT.stylizePath, posixizePath: typeof UtilFT.posixizePath, win32izePath: typeof UtilFT.win32izePath;
|
package/dist/QuickFunction.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.stylizePath = exports.throwError = exports.dedent = exports.mapEntries = exports.getTime = exports.stringifyJToken = exports.sleep = exports.deepClone = exports.assertLiteral = exports.assertType = exports.expect = exports.likeNone = exports.isSuccess = exports.isSafeNumber = exports.isFailed = exports.sucesProc = exports.matchProc = exports.outcome = void 0;
|
|
3
|
+
exports.win32izePath = exports.posixizePath = exports.stylizePath = exports.throwError = exports.dedent = exports.mapEntries = exports.getTime = exports.stringifyJToken = exports.sleep = exports.deepClone = exports.assertLiteral = exports.assertType = exports.expect = exports.likeNone = exports.isSuccess = exports.isSafeNumber = exports.isFailed = exports.sucesProc = exports.matchProc = exports.outcome = void 0;
|
|
4
4
|
const UtilFileTools_1 = require("./UtilFileTools");
|
|
5
5
|
const UtilFunctions_1 = require("./UtilFunctions");
|
|
6
6
|
const UtilSymbol_1 = require("./UtilSymbol");
|
|
7
7
|
exports.outcome = UtilFunctions_1.UtilFunc.outcome, exports.matchProc = UtilFunctions_1.UtilFunc.matchProc, exports.sucesProc = UtilFunctions_1.UtilFunc.sucesProc, exports.isFailed = UtilFunctions_1.UtilFunc.isFailed, exports.isSafeNumber = UtilFunctions_1.UtilFunc.isSafeNumber, exports.isSuccess = UtilFunctions_1.UtilFunc.isSuccess, exports.likeNone = UtilFunctions_1.UtilFunc.likeNone, exports.expect = UtilFunctions_1.UtilFunc.expect, 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;
|
|
8
|
-
exports.stylizePath = UtilFileTools_1.UtilFT.stylizePath;
|
|
8
|
+
exports.stylizePath = UtilFileTools_1.UtilFT.stylizePath, exports.posixizePath = UtilFileTools_1.UtilFT.posixizePath, exports.win32izePath = UtilFileTools_1.UtilFT.win32izePath;
|
|
9
9
|
if (false) {
|
|
10
10
|
let aaser = (0, exports.assertLiteral)({ a: 1 });
|
|
11
11
|
let a = null;
|
package/dist/UtilFileTools.d.ts
CHANGED
|
@@ -107,6 +107,16 @@ export declare namespace UtilFT {
|
|
|
107
107
|
* @returns 新的符合目标风格的路径
|
|
108
108
|
*/
|
|
109
109
|
function stylizePath(filePath: string, style?: 'win32' | 'posix'): string;
|
|
110
|
+
/**保证路径为POSIX风格
|
|
111
|
+
* @param filePath - 输入路径
|
|
112
|
+
* @returns 新的符合POSIX风格的路径
|
|
113
|
+
*/
|
|
114
|
+
function posixizePath(filePath: string): string;
|
|
115
|
+
/**保证路径为Win32风格
|
|
116
|
+
* @param filePath - 输入路径
|
|
117
|
+
* @returns 新的符合Win32风格的路径
|
|
118
|
+
*/
|
|
119
|
+
function win32izePath(filePath: string): string;
|
|
110
120
|
/**搜索路径符合正则表达式的文件
|
|
111
121
|
* @param dir - 起始目录
|
|
112
122
|
* @param traitRegex - 正则表达式
|
package/dist/UtilFileTools.js
CHANGED
|
@@ -207,6 +207,22 @@ var UtilFT;
|
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
209
|
UtilFT.stylizePath = stylizePath;
|
|
210
|
+
/**保证路径为POSIX风格
|
|
211
|
+
* @param filePath - 输入路径
|
|
212
|
+
* @returns 新的符合POSIX风格的路径
|
|
213
|
+
*/
|
|
214
|
+
function posixizePath(filePath) {
|
|
215
|
+
return stylizePath(filePath, 'posix');
|
|
216
|
+
}
|
|
217
|
+
UtilFT.posixizePath = posixizePath;
|
|
218
|
+
/**保证路径为Win32风格
|
|
219
|
+
* @param filePath - 输入路径
|
|
220
|
+
* @returns 新的符合Win32风格的路径
|
|
221
|
+
*/
|
|
222
|
+
function win32izePath(filePath) {
|
|
223
|
+
return stylizePath(filePath, 'win32');
|
|
224
|
+
}
|
|
225
|
+
UtilFT.win32izePath = win32izePath;
|
|
210
226
|
/**搜索路径符合正则表达式的文件
|
|
211
227
|
* @param dir - 起始目录
|
|
212
228
|
* @param traitRegex - 正则表达式
|
package/package.json
CHANGED
package/src/QuickFunction.ts
CHANGED
package/src/UtilFileTools.ts
CHANGED
|
@@ -242,6 +242,23 @@ export function stylizePath(filePath:string,style?:'win32'|'posix'){
|
|
|
242
242
|
win32: (nor) => filePath.replaceAll("/", "\\"),
|
|
243
243
|
});
|
|
244
244
|
}
|
|
245
|
+
/**保证路径为POSIX风格
|
|
246
|
+
* @param filePath - 输入路径
|
|
247
|
+
* @returns 新的符合POSIX风格的路径
|
|
248
|
+
*/
|
|
249
|
+
export function posixizePath(filePath: string): string {
|
|
250
|
+
return stylizePath(filePath, 'posix');
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**保证路径为Win32风格
|
|
254
|
+
* @param filePath - 输入路径
|
|
255
|
+
* @returns 新的符合Win32风格的路径
|
|
256
|
+
*/
|
|
257
|
+
export function win32izePath(filePath: string): string {
|
|
258
|
+
return stylizePath(filePath, 'win32');
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
|
|
245
262
|
|
|
246
263
|
/**搜索路径符合正则表达式的文件
|
|
247
264
|
* @param dir - 起始目录
|