mm_expand 1.6.4 → 1.6.6
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/index.js +12 -6
- package/package.json +1 -1
- package/test.js +1 -1
package/index.js
CHANGED
|
@@ -28,7 +28,8 @@ const {
|
|
|
28
28
|
join,
|
|
29
29
|
dirname,
|
|
30
30
|
basename,
|
|
31
|
-
extname
|
|
31
|
+
extname,
|
|
32
|
+
resolve
|
|
32
33
|
} = require('path');
|
|
33
34
|
const {
|
|
34
35
|
inspect
|
|
@@ -47,6 +48,7 @@ const Lang = require('./lang.js');
|
|
|
47
48
|
* @type {String}
|
|
48
49
|
*/
|
|
49
50
|
const slash = join('/');
|
|
51
|
+
const rootPath = resolve();
|
|
50
52
|
|
|
51
53
|
/* == 基础函数 == */
|
|
52
54
|
/**
|
|
@@ -536,6 +538,8 @@ if (typeof($) === "undefined") {
|
|
|
536
538
|
},
|
|
537
539
|
// 当前系统路径使用的斜杠
|
|
538
540
|
slash: slash,
|
|
541
|
+
// 系统跟目录
|
|
542
|
+
rootPath, rootPath,
|
|
539
543
|
// 运行根目录
|
|
540
544
|
runPath: process.cwd() + slash,
|
|
541
545
|
// 延迟
|
|
@@ -1265,11 +1269,13 @@ if (typeof($) === "undefined") {
|
|
|
1265
1269
|
dir = $.runPath;
|
|
1266
1270
|
}
|
|
1267
1271
|
file = file.replace(/\//g, slash);
|
|
1268
|
-
if (!file.startWith($.
|
|
1269
|
-
if (file.startWith(
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1272
|
+
if (!file.startWith($.rootPath)) {
|
|
1273
|
+
if (!file.startWith($.runPath)) {
|
|
1274
|
+
if (file.startWith(slash)) {
|
|
1275
|
+
file = join($.rootPath, file);
|
|
1276
|
+
} else {
|
|
1277
|
+
file = join(dir, file);
|
|
1278
|
+
}
|
|
1273
1279
|
}
|
|
1274
1280
|
}
|
|
1275
1281
|
if (!file.endsWith(slash)) {
|
package/package.json
CHANGED