@ainc/fs 0.1.16 → 0.1.17
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/LICENSE +1 -1
- package/README.md +18 -42
- package/dist/findUp.d.ts +6 -0
- package/dist/findUp.js +36 -0
- package/dist/index.d.ts +7 -38
- package/dist/index.js +21 -80
- package/dist/jsonc.d.ts +4 -20
- package/dist/jsonc.js +14 -31
- package/dist/lookup.d.ts +18 -0
- package/dist/lookup.js +64 -0
- package/dist/readFile.d.ts +1 -25
- package/dist/readFile.js +9 -12
- package/dist/relative.d.ts +12 -1
- package/dist/relative.js +47 -16
- package/dist/resolveFile.d.ts +6 -0
- package/dist/resolveFile.js +41 -0
- package/dist/{extname.d.ts → rm.d.ts} +2 -3
- package/dist/rm.js +35 -0
- package/dist/stat.d.ts +1 -16
- package/dist/stat.js +4 -11
- package/dist/{helpers → utils}/stripComments.d.ts +1 -2
- package/dist/utils/stripComments.js +120 -0
- package/package.json +33 -30
- package/bin/clean.js +0 -45
- package/bin/cli.js +0 -42
- package/bin/git.js +0 -40
- package/bin/run.js +0 -41
- package/dist/basename.d.ts +0 -7
- package/dist/basename.d.ts.map +0 -1
- package/dist/basename.js +0 -17
- package/dist/basename.js.map +0 -1
- package/dist/copy.d.ts +0 -41
- package/dist/copy.d.ts.map +0 -1
- package/dist/copy.js +0 -90
- package/dist/copy.js.map +0 -1
- package/dist/cpdir.d.ts +0 -20
- package/dist/cpdir.d.ts.map +0 -1
- package/dist/cpdir.js +0 -29
- package/dist/cpdir.js.map +0 -1
- package/dist/cwd.d.ts +0 -7
- package/dist/cwd.d.ts.map +0 -1
- package/dist/cwd.js +0 -17
- package/dist/cwd.js.map +0 -1
- package/dist/dirname.d.ts +0 -7
- package/dist/dirname.d.ts.map +0 -1
- package/dist/dirname.js +0 -31
- package/dist/dirname.js.map +0 -1
- package/dist/extname.d.ts.map +0 -1
- package/dist/extname.js +0 -17
- package/dist/extname.js.map +0 -1
- package/dist/filename.d.ts +0 -7
- package/dist/filename.d.ts.map +0 -1
- package/dist/filename.js +0 -25
- package/dist/filename.js.map +0 -1
- package/dist/find.d.ts +0 -27
- package/dist/find.d.ts.map +0 -1
- package/dist/find.js +0 -73
- package/dist/find.js.map +0 -1
- package/dist/findFile.d.ts +0 -21
- package/dist/findFile.d.ts.map +0 -1
- package/dist/findFile.js +0 -40
- package/dist/findFile.js.map +0 -1
- package/dist/finddir.d.ts +0 -21
- package/dist/finddir.d.ts.map +0 -1
- package/dist/finddir.js +0 -40
- package/dist/finddir.js.map +0 -1
- package/dist/helpers/FileResolver.d.ts +0 -54
- package/dist/helpers/FileResolver.d.ts.map +0 -1
- package/dist/helpers/FileResolver.js +0 -184
- package/dist/helpers/FileResolver.js.map +0 -1
- package/dist/helpers/compose.d.ts +0 -14
- package/dist/helpers/compose.d.ts.map +0 -1
- package/dist/helpers/compose.js +0 -38
- package/dist/helpers/compose.js.map +0 -1
- package/dist/helpers/each.d.ts +0 -7
- package/dist/helpers/each.d.ts.map +0 -1
- package/dist/helpers/each.js +0 -21
- package/dist/helpers/each.js.map +0 -1
- package/dist/helpers/match.d.ts +0 -7
- package/dist/helpers/match.d.ts.map +0 -1
- package/dist/helpers/match.js +0 -30
- package/dist/helpers/match.js.map +0 -1
- package/dist/helpers/normalizePath.d.ts +0 -23
- package/dist/helpers/normalizePath.d.ts.map +0 -1
- package/dist/helpers/normalizePath.js +0 -37
- package/dist/helpers/normalizePath.js.map +0 -1
- package/dist/helpers/safeCall.d.ts +0 -7
- package/dist/helpers/safeCall.d.ts.map +0 -1
- package/dist/helpers/safeCall.js +0 -24
- package/dist/helpers/safeCall.js.map +0 -1
- package/dist/helpers/split.d.ts +0 -7
- package/dist/helpers/split.d.ts.map +0 -1
- package/dist/helpers/split.js +0 -25
- package/dist/helpers/split.js.map +0 -1
- package/dist/helpers/stripBOM.d.ts +0 -7
- package/dist/helpers/stripBOM.d.ts.map +0 -1
- package/dist/helpers/stripBOM.js +0 -19
- package/dist/helpers/stripBOM.js.map +0 -1
- package/dist/helpers/stripComments.d.ts.map +0 -1
- package/dist/helpers/stripComments.js +0 -147
- package/dist/helpers/stripComments.js.map +0 -1
- package/dist/homedir.d.ts +0 -7
- package/dist/homedir.d.ts.map +0 -1
- package/dist/homedir.js +0 -32
- package/dist/homedir.js.map +0 -1
- package/dist/includePaths.d.ts +0 -7
- package/dist/includePaths.d.ts.map +0 -1
- package/dist/includePaths.js +0 -54
- package/dist/includePaths.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/indir.d.ts +0 -14
- package/dist/indir.d.ts.map +0 -1
- package/dist/indir.js +0 -27
- package/dist/indir.js.map +0 -1
- package/dist/isAbsolutePath.d.ts +0 -7
- package/dist/isAbsolutePath.d.ts.map +0 -1
- package/dist/isAbsolutePath.js +0 -25
- package/dist/isAbsolutePath.js.map +0 -1
- package/dist/isDirectory.d.ts +0 -13
- package/dist/isDirectory.d.ts.map +0 -1
- package/dist/isDirectory.js +0 -27
- package/dist/isDirectory.js.map +0 -1
- package/dist/isRelativePath.d.ts +0 -7
- package/dist/isRelativePath.d.ts.map +0 -1
- package/dist/isRelativePath.js +0 -45
- package/dist/isRelativePath.js.map +0 -1
- package/dist/json.d.ts +0 -22
- package/dist/json.d.ts.map +0 -1
- package/dist/json.js +0 -35
- package/dist/json.js.map +0 -1
- package/dist/jsonc.d.ts.map +0 -1
- package/dist/jsonc.js.map +0 -1
- package/dist/lstat.d.ts +0 -23
- package/dist/lstat.d.ts.map +0 -1
- package/dist/lstat.js +0 -31
- package/dist/lstat.js.map +0 -1
- package/dist/mapdir.d.ts +0 -23
- package/dist/mapdir.d.ts.map +0 -1
- package/dist/mapdir.js +0 -43
- package/dist/mapdir.js.map +0 -1
- package/dist/mkdir.d.ts +0 -7
- package/dist/mkdir.d.ts.map +0 -1
- package/dist/mkdir.js +0 -38
- package/dist/mkdir.js.map +0 -1
- package/dist/parseJSON.d.ts +0 -16
- package/dist/parseJSON.d.ts.map +0 -1
- package/dist/parseJSON.js +0 -29
- package/dist/parseJSON.js.map +0 -1
- package/dist/readFile.d.ts.map +0 -1
- package/dist/readFile.js.map +0 -1
- package/dist/readStream.d.ts +0 -37
- package/dist/readStream.d.ts.map +0 -1
- package/dist/readStream.js +0 -20
- package/dist/readStream.js.map +0 -1
- package/dist/readdir.d.ts +0 -17
- package/dist/readdir.d.ts.map +0 -1
- package/dist/readdir.js +0 -35
- package/dist/readdir.js.map +0 -1
- package/dist/readline.d.ts +0 -17
- package/dist/readline.d.ts.map +0 -1
- package/dist/readline.js +0 -25
- package/dist/readline.js.map +0 -1
- package/dist/realpath.d.ts +0 -13
- package/dist/realpath.d.ts.map +0 -1
- package/dist/realpath.js +0 -33
- package/dist/realpath.js.map +0 -1
- package/dist/relative.d.ts.map +0 -1
- package/dist/relative.js.map +0 -1
- package/dist/resolve.d.ts +0 -27
- package/dist/resolve.d.ts.map +0 -1
- package/dist/resolve.js +0 -54
- package/dist/resolve.js.map +0 -1
- package/dist/resolvePath.d.ts +0 -27
- package/dist/resolvePath.d.ts.map +0 -1
- package/dist/resolvePath.js +0 -178
- package/dist/resolvePath.js.map +0 -1
- package/dist/rmdir.d.ts +0 -7
- package/dist/rmdir.d.ts.map +0 -1
- package/dist/rmdir.js +0 -41
- package/dist/rmdir.js.map +0 -1
- package/dist/stat.d.ts.map +0 -1
- package/dist/stat.js.map +0 -1
- package/dist/supdir.d.ts +0 -22
- package/dist/supdir.d.ts.map +0 -1
- package/dist/supdir.js +0 -63
- package/dist/supdir.js.map +0 -1
- package/dist/symlink.d.ts +0 -23
- package/dist/symlink.d.ts.map +0 -1
- package/dist/symlink.js +0 -40
- package/dist/symlink.js.map +0 -1
- package/dist/unlink.d.ts +0 -7
- package/dist/unlink.d.ts.map +0 -1
- package/dist/unlink.js +0 -29
- package/dist/unlink.js.map +0 -1
- package/dist/usedir.d.ts +0 -7
- package/dist/usedir.d.ts.map +0 -1
- package/dist/usedir.js +0 -25
- package/dist/usedir.js.map +0 -1
- package/dist/writeFile.d.ts +0 -34
- package/dist/writeFile.d.ts.map +0 -1
- package/dist/writeFile.js +0 -50
- package/dist/writeFile.js.map +0 -1
- package/dist/writeStream.d.ts +0 -36
- package/dist/writeStream.d.ts.map +0 -1
- package/dist/writeStream.js +0 -20
- package/dist/writeStream.js.map +0 -1
- package/src/basename.ts +0 -15
- package/src/copy.ts +0 -141
- package/src/cpdir.ts +0 -47
- package/src/cwd.ts +0 -15
- package/src/dirname.ts +0 -34
- package/src/extname.ts +0 -15
- package/src/filename.ts +0 -25
- package/src/find.ts +0 -106
- package/src/findFile.ts +0 -61
- package/src/finddir.ts +0 -61
- package/src/helpers/FileResolver.ts +0 -282
- package/src/helpers/compose.ts +0 -49
- package/src/helpers/each.ts +0 -19
- package/src/helpers/match.ts +0 -31
- package/src/helpers/normalizePath.ts +0 -51
- package/src/helpers/safeCall.ts +0 -21
- package/src/helpers/split.ts +0 -25
- package/src/helpers/stripBOM.ts +0 -17
- package/src/helpers/stripComments.ts +0 -173
- package/src/homedir.ts +0 -34
- package/src/includePaths.ts +0 -62
- package/src/index.ts +0 -52
- package/src/indir.ts +0 -45
- package/src/isAbsolutePath.ts +0 -25
- package/src/isDirectory.ts +0 -28
- package/src/isRelativePath.ts +0 -52
- package/src/json.ts +0 -62
- package/src/jsonc.ts +0 -81
- package/src/lstat.ts +0 -40
- package/src/mapdir.ts +0 -59
- package/src/mkdir.ts +0 -43
- package/src/parseJSON.ts +0 -40
- package/src/readFile.ts +0 -64
- package/src/readStream.ts +0 -53
- package/src/readdir.ts +0 -51
- package/src/readline.ts +0 -42
- package/src/realpath.ts +0 -35
- package/src/relative.ts +0 -43
- package/src/resolve.ts +0 -83
- package/src/resolvePath.ts +0 -234
- package/src/rmdir.ts +0 -44
- package/src/stat.ts +0 -40
- package/src/supdir.ts +0 -79
- package/src/symlink.ts +0 -67
- package/src/unlink.ts +0 -31
- package/src/usedir.ts +0 -25
- package/src/writeFile.ts +0 -86
- package/src/writeStream.ts +0 -52
package/dist/mapdir.d.ts
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
*****************************************
|
|
4
|
-
* 加载依赖
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
import * as fs from 'fs';
|
|
8
|
-
/**
|
|
9
|
-
*****************************************
|
|
10
|
-
* 遍历回调
|
|
11
|
-
*****************************************
|
|
12
|
-
*/
|
|
13
|
-
interface Handler<T> {
|
|
14
|
-
(path: string, stats: fs.Stats): T;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
*****************************************
|
|
18
|
-
* 遍历目录
|
|
19
|
-
*****************************************
|
|
20
|
-
*/
|
|
21
|
-
export declare function mapdir<T>(dir: string, handler: Handler<T>): T[];
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=mapdir.d.ts.map
|
package/dist/mapdir.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapdir.d.ts","sourceRoot":"","sources":["../src/mapdir.ts"],"names":[],"mappings":";AASA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAKzB;;;;GAIG;AACH,UAAU,OAAO,CAAC,CAAC;IACf,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC;CACtC;AAGD;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAwB/D"}
|
package/dist/mapdir.js
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* Created by edonet@163.com
|
|
4
|
-
* Created on 2019-11-09 16:35:57
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.mapdir = void 0;
|
|
10
|
-
/**
|
|
11
|
-
*****************************************
|
|
12
|
-
* 加载依赖
|
|
13
|
-
*****************************************
|
|
14
|
-
*/
|
|
15
|
-
const fs = require("fs");
|
|
16
|
-
const path = require("path");
|
|
17
|
-
const stat_1 = require("./stat");
|
|
18
|
-
/**
|
|
19
|
-
*****************************************
|
|
20
|
-
* 遍历目录
|
|
21
|
-
*****************************************
|
|
22
|
-
*/
|
|
23
|
-
function mapdir(dir, handler) {
|
|
24
|
-
let stats = (0, stat_1.stat)(dir), result = [];
|
|
25
|
-
// 存在目录
|
|
26
|
-
if (stats) {
|
|
27
|
-
let dirname = stats.path, ignore = ['node_modules', '.DS_Store'];
|
|
28
|
-
// 遍历子文件
|
|
29
|
-
if (stats.isDirectory()) {
|
|
30
|
-
fs.readdirSync(stats.path).forEach(name => {
|
|
31
|
-
if (!ignore.includes(name)) {
|
|
32
|
-
result.push(...mapdir(path.join(dirname, name), handler));
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
// 执行回调
|
|
37
|
-
result.push(handler(dirname, stats));
|
|
38
|
-
}
|
|
39
|
-
// 返回结果
|
|
40
|
-
return result;
|
|
41
|
-
}
|
|
42
|
-
exports.mapdir = mapdir;
|
|
43
|
-
//# sourceMappingURL=mapdir.js.map
|
package/dist/mapdir.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mapdir.js","sourceRoot":"","sources":["../src/mapdir.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,yBAAyB;AACzB,6BAA6B;AAC7B,iCAA8B;AAa9B;;;;GAIG;AACH,SAAgB,MAAM,CAAI,GAAW,EAAE,OAAmB;IACtD,IAAI,KAAK,GAAG,IAAA,WAAI,EAAC,GAAG,CAAC,EACjB,MAAM,GAAQ,EAAE,CAAC;IAErB,OAAO;IACP,IAAI,KAAK,EAAE;QACP,IAAI,OAAO,GAAG,KAAK,CAAC,IAAI,EACpB,MAAM,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC;QAE3C,QAAQ;QACR,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE;YACrB,EAAE,CAAC,WAAW,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;gBACtC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;oBACxB,MAAM,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;iBAC7D;YACL,CAAC,CAAC,CAAC;SACN;QAED,OAAO;QACP,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;KACxC;IAED,OAAO;IACP,OAAO,MAAM,CAAC;AAClB,CAAC;AAxBD,wBAwBC"}
|
package/dist/mkdir.d.ts
DELETED
package/dist/mkdir.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mkdir.d.ts","sourceRoot":"","sources":["../src/mkdir.ts"],"names":[],"mappings":"AAoBA;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAiBzC"}
|
package/dist/mkdir.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* Created by edonet@163.com
|
|
4
|
-
* Created on 2019-11-07 16:48:57
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.mkdir = void 0;
|
|
10
|
-
/**
|
|
11
|
-
*****************************************
|
|
12
|
-
* 加载依赖
|
|
13
|
-
*****************************************
|
|
14
|
-
*/
|
|
15
|
-
const fs = require("fs");
|
|
16
|
-
const path = require("path");
|
|
17
|
-
const isDirectory_1 = require("./isDirectory");
|
|
18
|
-
const dirname_1 = require("./dirname");
|
|
19
|
-
/**
|
|
20
|
-
*****************************************
|
|
21
|
-
* 创建目录
|
|
22
|
-
*****************************************
|
|
23
|
-
*/
|
|
24
|
-
function mkdir(dir) {
|
|
25
|
-
// 解析目录
|
|
26
|
-
dir = path.resolve(dir);
|
|
27
|
-
// 创建目录
|
|
28
|
-
if (!(0, isDirectory_1.isDirectory)(dir)) {
|
|
29
|
-
// 创建上级目录
|
|
30
|
-
mkdir((0, dirname_1.dirname)(dir));
|
|
31
|
-
// 创建目录
|
|
32
|
-
fs.mkdirSync(dir);
|
|
33
|
-
}
|
|
34
|
-
// 返回目录
|
|
35
|
-
return dir;
|
|
36
|
-
}
|
|
37
|
-
exports.mkdir = mkdir;
|
|
38
|
-
//# sourceMappingURL=mkdir.js.map
|
package/dist/mkdir.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mkdir.js","sourceRoot":"","sources":["../src/mkdir.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,yBAAyB;AACzB,6BAA6B;AAC7B,+CAA4C;AAC5C,uCAAoC;AAGpC;;;;GAIG;AACH,SAAgB,KAAK,CAAC,GAAW;IAE7B,OAAO;IACP,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAExB,OAAO;IACP,IAAI,CAAC,IAAA,yBAAW,EAAC,GAAG,CAAC,EAAE;QAEnB,SAAS;QACT,KAAK,CAAC,IAAA,iBAAO,EAAC,GAAG,CAAC,CAAC,CAAC;QAEpB,OAAO;QACP,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;KACrB;IAED,OAAO;IACP,OAAO,GAAG,CAAC;AACf,CAAC;AAjBD,sBAiBC"}
|
package/dist/parseJSON.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* 选项
|
|
4
|
-
*****************************************
|
|
5
|
-
*/
|
|
6
|
-
interface Options {
|
|
7
|
-
comments?: boolean;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
*****************************************
|
|
11
|
-
* 解析【JSON】文件
|
|
12
|
-
*****************************************
|
|
13
|
-
*/
|
|
14
|
-
export declare function parseJSON<T>(content: string, options?: Options): T;
|
|
15
|
-
export {};
|
|
16
|
-
//# sourceMappingURL=parseJSON.d.ts.map
|
package/dist/parseJSON.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseJSON.d.ts","sourceRoot":"","sources":["../src/parseJSON.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,UAAU,OAAO;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB;AAGD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,OAAY,GAAG,CAAC,CAMtE"}
|
package/dist/parseJSON.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* Created by edonet@163.com
|
|
4
|
-
* Created on 2022-01-01 21:01:19
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.parseJSON = void 0;
|
|
10
|
-
/**
|
|
11
|
-
*****************************************
|
|
12
|
-
* 加载依赖
|
|
13
|
-
*****************************************
|
|
14
|
-
*/
|
|
15
|
-
const stripBOM_1 = require("./helpers/stripBOM");
|
|
16
|
-
const stripComments_1 = require("./helpers/stripComments");
|
|
17
|
-
/**
|
|
18
|
-
*****************************************
|
|
19
|
-
* 解析【JSON】文件
|
|
20
|
-
*****************************************
|
|
21
|
-
*/
|
|
22
|
-
function parseJSON(content, options = {}) {
|
|
23
|
-
const normalized = options.comments ? (0, stripComments_1.stripComments)(content) : (0, stripBOM_1.stripBOM)(content);
|
|
24
|
-
const source = normalized.trim();
|
|
25
|
-
// 解析内容
|
|
26
|
-
return source ? JSON.parse(source) : undefined;
|
|
27
|
-
}
|
|
28
|
-
exports.parseJSON = parseJSON;
|
|
29
|
-
//# sourceMappingURL=parseJSON.js.map
|
package/dist/parseJSON.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parseJSON.js","sourceRoot":"","sources":["../src/parseJSON.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,iDAA8C;AAC9C,2DAAwD;AAaxD;;;;GAIG;AACH,SAAgB,SAAS,CAAI,OAAe,EAAE,UAAmB,EAAE;IAC/D,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,6BAAa,EAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAA,mBAAQ,EAAC,OAAO,CAAC,CAAC;IACjF,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,EAAE,CAAC;IAEjC,OAAO;IACP,OAAO,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACnD,CAAC;AAND,8BAMC"}
|
package/dist/readFile.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readFile.d.ts","sourceRoot":"","sources":["../src/readFile.ts"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,aAAK,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,QAAQ,GAAG,KAAK,CAAC;AAGnH;;;;GAIG;AACH,UAAU,OAAO;IACb,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD;;;;GAIG;AACH,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;AACxC,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;AAC5D,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAAC;AAc1D;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/readFile.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readFile.js","sourceRoot":"","sources":["../src/readFile.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,yBAAyB;AACzB,iCAA8B;AA8B9B,SAAS,QAAQ,CAAC,IAAY,EAAE,QAA6B;IACzD,IAAI,KAAK,GAAG,IAAA,WAAI,EAAC,IAAI,CAAC,CAAC;IAEvB,OAAO;IACP,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE;QAC/B,OAAO,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,QAAoB,IAAI,MAAM,CAAC,CAAC;KAChE;IAED,MAAM;IACN,OAAO,EAAE,CAAC;AACd,CAAC;AAQQ,4BAAQ"}
|
package/dist/readStream.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/**
|
|
3
|
-
*****************************************
|
|
4
|
-
* 加载依赖
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
import * as fs from 'fs';
|
|
8
|
-
/**
|
|
9
|
-
*****************************************
|
|
10
|
-
* 配置
|
|
11
|
-
*****************************************
|
|
12
|
-
*/
|
|
13
|
-
export interface Options {
|
|
14
|
-
flags?: string | undefined;
|
|
15
|
-
encoding?: BufferEncoding | undefined;
|
|
16
|
-
fd?: number | undefined;
|
|
17
|
-
mode?: number | undefined;
|
|
18
|
-
autoClose?: boolean | undefined;
|
|
19
|
-
emitClose?: boolean | undefined;
|
|
20
|
-
start?: number | undefined;
|
|
21
|
-
end?: number | undefined;
|
|
22
|
-
highWaterMark?: number | undefined;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
*****************************************
|
|
26
|
-
* 创建可读流
|
|
27
|
-
*****************************************
|
|
28
|
-
*/
|
|
29
|
-
declare function readStream(path: string, encoding?: BufferEncoding): fs.ReadStream;
|
|
30
|
-
declare function readStream(path: string, options?: Options): fs.ReadStream;
|
|
31
|
-
/**
|
|
32
|
-
*****************************************
|
|
33
|
-
* 抛出接口
|
|
34
|
-
*****************************************
|
|
35
|
-
*/
|
|
36
|
-
export { readStream };
|
|
37
|
-
//# sourceMappingURL=readStream.d.ts.map
|
package/dist/readStream.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readStream.d.ts","sourceRoot":"","sources":["../src/readStream.ts"],"names":[],"mappings":";AASA;;;;GAIG;AACH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAGzB;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACpB,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,QAAQ,CAAC,EAAE,cAAc,GAAG,SAAS,CAAC;IACtC,EAAE,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC1B,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACtC;AAGD;;;;GAIG;AACH,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,EAAE,CAAC,UAAU,CAAC;AAC5E,iBAAS,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,EAAE,CAAC,UAAU,CAAC;AAMpE;;;;GAIG;AACH,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/readStream.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* Created by edonet@163.com
|
|
4
|
-
* Created on 2021-05-22 11:41:18
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.readStream = void 0;
|
|
10
|
-
/**
|
|
11
|
-
*****************************************
|
|
12
|
-
* 加载依赖
|
|
13
|
-
*****************************************
|
|
14
|
-
*/
|
|
15
|
-
const fs = require("fs");
|
|
16
|
-
function readStream(path, options) {
|
|
17
|
-
return fs.createReadStream(path, options);
|
|
18
|
-
}
|
|
19
|
-
exports.readStream = readStream;
|
|
20
|
-
//# sourceMappingURL=readStream.js.map
|
package/dist/readStream.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readStream.js","sourceRoot":"","sources":["../src/readStream.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,yBAAyB;AA4BzB,SAAS,UAAU,CAAC,IAAY,EAAE,OAAkC;IAChE,OAAO,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;AAC9C,CAAC;AAQQ,gCAAU"}
|
package/dist/readdir.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* 状态
|
|
4
|
-
*****************************************
|
|
5
|
-
*/
|
|
6
|
-
interface State {
|
|
7
|
-
name: string;
|
|
8
|
-
path: string;
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
*****************************************
|
|
12
|
-
* 读取目录
|
|
13
|
-
*****************************************
|
|
14
|
-
*/
|
|
15
|
-
export declare function readdir(dir: string): State[];
|
|
16
|
-
export {};
|
|
17
|
-
//# sourceMappingURL=readdir.d.ts.map
|
package/dist/readdir.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readdir.d.ts","sourceRoot":"","sources":["../src/readdir.ts"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH,UAAU,KAAK;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CAChB;AAGD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,CAe5C"}
|
package/dist/readdir.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* Created by edonet@163.com
|
|
4
|
-
* Created on 2019-11-07 16:20:26
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.readdir = void 0;
|
|
10
|
-
/**
|
|
11
|
-
*****************************************
|
|
12
|
-
* 加载依赖
|
|
13
|
-
*****************************************
|
|
14
|
-
*/
|
|
15
|
-
const fs = require("fs");
|
|
16
|
-
const path = require("path");
|
|
17
|
-
const isDirectory_1 = require("./isDirectory");
|
|
18
|
-
/**
|
|
19
|
-
*****************************************
|
|
20
|
-
* 读取目录
|
|
21
|
-
*****************************************
|
|
22
|
-
*/
|
|
23
|
-
function readdir(dir) {
|
|
24
|
-
let stats = (0, isDirectory_1.isDirectory)(dir);
|
|
25
|
-
// 存在目录
|
|
26
|
-
if (stats) {
|
|
27
|
-
dir = stats.path;
|
|
28
|
-
// 读取文件夹
|
|
29
|
-
return fs.readdirSync(dir).map(name => ({ name, path: path.join(dir, name) }));
|
|
30
|
-
}
|
|
31
|
-
// 返回对象
|
|
32
|
-
return [];
|
|
33
|
-
}
|
|
34
|
-
exports.readdir = readdir;
|
|
35
|
-
//# sourceMappingURL=readdir.js.map
|
package/dist/readdir.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readdir.js","sourceRoot":"","sources":["../src/readdir.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,yBAAyB;AACzB,6BAA6B;AAC7B,+CAA4C;AAc5C;;;;GAIG;AACH,SAAgB,OAAO,CAAC,GAAW;IAC/B,IAAI,KAAK,GAAG,IAAA,yBAAW,EAAC,GAAG,CAAC,CAAC;IAE7B,OAAO;IACP,IAAI,KAAK,EAAE;QACP,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC;QAEjB,QAAQ;QACR,OAAO,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,GAAG,CAC1B,IAAI,CAAC,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,EAAE,CAAC,CACjD,CAAC;KACL;IAED,OAAO;IACP,OAAO,EAAE,CAAC;AACd,CAAC;AAfD,0BAeC"}
|
package/dist/readline.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Readable } from 'stream';
|
|
3
|
-
import { Options } from './readStream';
|
|
4
|
-
/**
|
|
5
|
-
*****************************************
|
|
6
|
-
* 逐行读取
|
|
7
|
-
*****************************************
|
|
8
|
-
*/
|
|
9
|
-
declare function readline(path: string, encoding?: BufferEncoding): Readable;
|
|
10
|
-
declare function readline(path: string, options?: Options): Readable;
|
|
11
|
-
/**
|
|
12
|
-
*****************************************
|
|
13
|
-
* 抛出接口
|
|
14
|
-
*****************************************
|
|
15
|
-
*/
|
|
16
|
-
export { readline };
|
|
17
|
-
//# sourceMappingURL=readline.d.ts.map
|
package/dist/readline.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readline.d.ts","sourceRoot":"","sources":["../src/readline.ts"],"names":[],"mappings":";AAeA,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGvC;;;;GAIG;AACH,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,cAAc,GAAG,QAAQ,CAAC;AACrE,iBAAS,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;AAU7D;;;;GAIG;AACH,OAAO,EAAE,QAAQ,EAAE,CAAC"}
|
package/dist/readline.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* Created by edonet@163.com
|
|
4
|
-
* Created on 2021-05-22 11:53:49
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.readline = void 0;
|
|
10
|
-
/**
|
|
11
|
-
*****************************************
|
|
12
|
-
* 加载依赖
|
|
13
|
-
*****************************************
|
|
14
|
-
*/
|
|
15
|
-
const fs = require("fs");
|
|
16
|
-
const stream_1 = require("stream");
|
|
17
|
-
const readline_1 = require("readline");
|
|
18
|
-
function readline(path, options) {
|
|
19
|
-
const input = fs.createReadStream(path, options);
|
|
20
|
-
const readable = stream_1.Readable.from((0, readline_1.createInterface)({ input, crlfDelay: Infinity }));
|
|
21
|
-
// 返回可读流
|
|
22
|
-
return readable;
|
|
23
|
-
}
|
|
24
|
-
exports.readline = readline;
|
|
25
|
-
//# sourceMappingURL=readline.js.map
|
package/dist/readline.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"readline.js","sourceRoot":"","sources":["../src/readline.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,yBAAyB;AACzB,mCAAkC;AAClC,uCAA2C;AAW3C,SAAS,QAAQ,CAAC,IAAY,EAAE,OAAkC;IAC9D,MAAM,KAAK,GAAG,EAAE,CAAC,gBAAgB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACjD,MAAM,QAAQ,GAAG,iBAAQ,CAAC,IAAI,CAAC,IAAA,0BAAe,EAAC,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;IAEhF,QAAQ;IACR,OAAO,QAAQ,CAAC;AACpB,CAAC;AAQQ,4BAAQ"}
|
package/dist/realpath.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* 获取基准路径
|
|
4
|
-
*****************************************
|
|
5
|
-
*/
|
|
6
|
-
export declare const baseDir: string;
|
|
7
|
-
/**
|
|
8
|
-
*****************************************
|
|
9
|
-
* 解析真实地址
|
|
10
|
-
*****************************************
|
|
11
|
-
*/
|
|
12
|
-
export declare function realpath(path: string): string;
|
|
13
|
-
//# sourceMappingURL=realpath.d.ts.map
|
package/dist/realpath.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"realpath.d.ts","sourceRoot":"","sources":["../src/realpath.ts"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH,eAAO,MAAM,OAAO,QAA8B,CAAC;AAGnD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAE7C"}
|
package/dist/realpath.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* Created by edonet@163.com
|
|
4
|
-
* Created on 2021-07-17 17:42:34
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.realpath = exports.baseDir = void 0;
|
|
10
|
-
/**
|
|
11
|
-
*****************************************
|
|
12
|
-
* 加载依赖
|
|
13
|
-
*****************************************
|
|
14
|
-
*/
|
|
15
|
-
const fs_1 = require("fs");
|
|
16
|
-
const path_1 = require("path");
|
|
17
|
-
const isAbsolutePath_1 = require("./isAbsolutePath");
|
|
18
|
-
/**
|
|
19
|
-
*****************************************
|
|
20
|
-
* 获取基准路径
|
|
21
|
-
*****************************************
|
|
22
|
-
*/
|
|
23
|
-
exports.baseDir = (0, fs_1.realpathSync)(process.cwd());
|
|
24
|
-
/**
|
|
25
|
-
*****************************************
|
|
26
|
-
* 解析真实地址
|
|
27
|
-
*****************************************
|
|
28
|
-
*/
|
|
29
|
-
function realpath(path) {
|
|
30
|
-
return (0, isAbsolutePath_1.isAbsolutePath)(path) ? (0, fs_1.realpathSync)(path) : (0, path_1.resolve)(exports.baseDir, path);
|
|
31
|
-
}
|
|
32
|
-
exports.realpath = realpath;
|
|
33
|
-
//# sourceMappingURL=realpath.js.map
|
package/dist/realpath.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"realpath.js","sourceRoot":"","sources":["../src/realpath.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,2BAAkC;AAClC,+BAA+B;AAC/B,qDAAkD;AAGlD;;;;GAIG;AACU,QAAA,OAAO,GAAG,IAAA,iBAAY,EAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;AAGnD;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACjC,OAAO,IAAA,+BAAc,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,iBAAY,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAA,cAAO,EAAC,eAAO,EAAE,IAAI,CAAC,CAAC;AAC9E,CAAC;AAFD,4BAEC"}
|
package/dist/relative.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relative.d.ts","sourceRoot":"","sources":["../src/relative.ts"],"names":[],"mappings":"AAiBA;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAoBzD"}
|
package/dist/relative.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"relative.js","sourceRoot":"","sources":["../src/relative.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,6BAA6B;AAG7B;;;;GAIG;AACH,SAAgB,QAAQ,CAAC,IAAY,EAAE,EAAU;IAC7C,IAAI,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAErC,QAAQ;IACR,IAAI,IAAI,CAAC,GAAG,KAAK,IAAI,EAAE;QACnB,MAAM,GAAG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACzC;IAED,SAAS;IACT,IAAI,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QAC1B,OAAO,IAAI,GAAG,MAAM,CAAC;KACxB;IAED,MAAM;IACN,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QACxD,OAAO,MAAM,GAAG,GAAG,CAAC;KACvB;IAED,OAAO;IACP,OAAO,MAAM,CAAC;AAClB,CAAC;AApBD,4BAoBC"}
|
package/dist/resolve.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* 解析配置
|
|
4
|
-
*****************************************
|
|
5
|
-
*/
|
|
6
|
-
export interface Options {
|
|
7
|
-
ext?: string;
|
|
8
|
-
test?: RegExp;
|
|
9
|
-
exclude?: string[];
|
|
10
|
-
}
|
|
11
|
-
/**
|
|
12
|
-
*****************************************
|
|
13
|
-
* 资源对象
|
|
14
|
-
*****************************************
|
|
15
|
-
*/
|
|
16
|
-
export interface Asset {
|
|
17
|
-
type: 'dir' | 'file';
|
|
18
|
-
dir: string;
|
|
19
|
-
files: string[];
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
*****************************************
|
|
23
|
-
* 解析文件
|
|
24
|
-
*****************************************
|
|
25
|
-
*/
|
|
26
|
-
export declare function resolve(dir: string | string[], options?: Options): Asset[];
|
|
27
|
-
//# sourceMappingURL=resolve.d.ts.map
|
package/dist/resolve.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAmBA;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAGD;;;;GAIG;AACH,MAAM,WAAW,KAAK;IAClB,IAAI,EAAE,KAAK,GAAG,MAAM,CAAC;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,EAAE,CAAC;CACnB;AAGD;;;;GAIG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,GAAE,OAAY,GAAG,KAAK,EAAE,CAkC9E"}
|
package/dist/resolve.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* Created by edonet@163.com
|
|
4
|
-
* Created on 2021-04-18 12:10:46
|
|
5
|
-
*****************************************
|
|
6
|
-
*/
|
|
7
|
-
'use strict';
|
|
8
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.resolve = void 0;
|
|
10
|
-
/**
|
|
11
|
-
*****************************************
|
|
12
|
-
* 加载依赖
|
|
13
|
-
*****************************************
|
|
14
|
-
*/
|
|
15
|
-
const stat_1 = require("./stat");
|
|
16
|
-
const dirname_1 = require("./dirname");
|
|
17
|
-
const findFile_1 = require("./findFile");
|
|
18
|
-
/**
|
|
19
|
-
*****************************************
|
|
20
|
-
* 解析文件
|
|
21
|
-
*****************************************
|
|
22
|
-
*/
|
|
23
|
-
function resolve(dir, options = {}) {
|
|
24
|
-
const input = Array.isArray(dir) ? dir : [dir];
|
|
25
|
-
const name = options.ext ? options.ext + '$' : options.test || '*';
|
|
26
|
-
const ignore = options.exclude ? ['node_modules', ...options.exclude] : ['node_modules'];
|
|
27
|
-
const assets = [];
|
|
28
|
-
// 解析文件
|
|
29
|
-
input.forEach(str => {
|
|
30
|
-
const stats = (0, stat_1.stat)(str);
|
|
31
|
-
// 不存在目录
|
|
32
|
-
if (!stats) {
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
// 文件入口
|
|
36
|
-
if (!stats.isDirectory()) {
|
|
37
|
-
return assets.push({
|
|
38
|
-
type: 'file',
|
|
39
|
-
dir: (0, dirname_1.dirname)(stats.path),
|
|
40
|
-
files: [stats.path],
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
// 处理文件夹
|
|
44
|
-
assets.push({
|
|
45
|
-
type: 'dir',
|
|
46
|
-
dir: stats.path,
|
|
47
|
-
files: (0, findFile_1.findFile)(name, stats.path, { ignore }),
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
// 返回结果
|
|
51
|
-
return assets;
|
|
52
|
-
}
|
|
53
|
-
exports.resolve = resolve;
|
|
54
|
-
//# sourceMappingURL=resolve.js.map
|
package/dist/resolve.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../src/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,YAAY,CAAC;;;AAGb;;;;GAIG;AACH,iCAA8B;AAC9B,uCAAoC;AACpC,yCAAsC;AA2BtC;;;;GAIG;AACH,SAAgB,OAAO,CAAC,GAAsB,EAAE,UAAmB,EAAE;IACjE,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,IAAI,GAAG,CAAC;IACnE,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC;IACzF,MAAM,MAAM,GAAY,EAAE,CAAC;IAE3B,OAAO;IACP,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE;QAChB,MAAM,KAAK,GAAG,IAAA,WAAI,EAAC,GAAG,CAAC,CAAC;QAExB,QAAQ;QACR,IAAI,CAAC,KAAK,EAAE;YACR,OAAO;SACV;QAED,OAAO;QACP,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,EAAE;YACtB,OAAO,MAAM,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,MAAM;gBACZ,GAAG,EAAE,IAAA,iBAAO,EAAC,KAAK,CAAC,IAAI,CAAC;gBACxB,KAAK,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC;aACtB,CAAC,CAAC;SACN;QAED,QAAQ;QACR,MAAM,CAAC,IAAI,CAAC;YACR,IAAI,EAAE,KAAK;YACX,GAAG,EAAE,KAAK,CAAC,IAAI;YACf,KAAK,EAAE,IAAA,mBAAQ,EAAC,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,EAAE,MAAM,EAAE,CAAC;SAChD,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;IAEH,OAAO;IACP,OAAO,MAAM,CAAC;AAClB,CAAC;AAlCD,0BAkCC"}
|
package/dist/resolvePath.d.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*****************************************
|
|
3
|
-
* 加载依赖
|
|
4
|
-
*****************************************
|
|
5
|
-
*/
|
|
6
|
-
import { Handler, Options as FileOptions } from './helpers/FileResolver';
|
|
7
|
-
/**
|
|
8
|
-
*****************************************
|
|
9
|
-
* 选项
|
|
10
|
-
*****************************************
|
|
11
|
-
*/
|
|
12
|
-
export interface Options extends FileOptions {
|
|
13
|
-
baseUrl?: string;
|
|
14
|
-
paths?: {
|
|
15
|
-
[key: string]: string[];
|
|
16
|
-
};
|
|
17
|
-
alias?: {
|
|
18
|
-
[key: string]: string | string[];
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
*****************************************
|
|
23
|
-
* 解析文件
|
|
24
|
-
*****************************************
|
|
25
|
-
*/
|
|
26
|
-
export declare function resolvePath(options?: Options): Handler;
|
|
27
|
-
//# sourceMappingURL=resolvePath.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolvePath.d.ts","sourceRoot":"","sources":["../src/resolvePath.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,OAAO,EAAoC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAyL3G;;;;GAIG;AACH,MAAM,WAAW,OAAQ,SAAQ,WAAW;IACxC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE;QACJ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;KAC3B,CAAC;IACF,KAAK,CAAC,EAAE;QACJ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;KACpC,CAAC;CACL;AAGD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE,OAAY,GAAG,OAAO,CAa1D"}
|