crabatool 1.0.340 → 1.0.345
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/package.json +2 -2
- package/tool/checkjs.js +2 -2
- package/tool/merge/mergeTool.js +5 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "crabatool",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.345",
|
|
4
4
|
"description": "crabatool",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"compression": "^1.7.4",
|
|
35
35
|
"crypto": "^1.0.1",
|
|
36
36
|
"eslint": "^8.18.0",
|
|
37
|
-
"eslint-plugin-native-ie": "
|
|
37
|
+
"eslint-plugin-native-ie": "0.1.2",
|
|
38
38
|
"express": "^4.17.3",
|
|
39
39
|
"htmlparser2": "^8.0.1",
|
|
40
40
|
"http-proxy-middleware": "^2.0.6",
|
package/tool/checkjs.js
CHANGED
|
@@ -159,13 +159,13 @@ module.exports.start = async function() {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
// trimEnd检查
|
|
162
|
-
var tstr = /\.
|
|
162
|
+
var tstr = /\.trim\(\s*['"]([^'"]){1}['"]\s*\)|\.trimStart\(\s*['"]([^'"]){1}['"]\s*\)|\.trimEnd\(\s*['"]([^'"]){1}['"]\s*\)/g;
|
|
163
163
|
if (tstr.test(content)) {
|
|
164
164
|
var noComment = utils.clearComment(content);// 去掉注释的代码再查一遍;因为js里面有些危险字符是被注释了的
|
|
165
165
|
|
|
166
166
|
// 二次检查
|
|
167
167
|
if (tstr.test(noComment)) {
|
|
168
|
-
var infoList = getMathReuslts(noComment, tstr, null, 'trimEnd(
|
|
168
|
+
var infoList = getMathReuslts(noComment, tstr, null, 'trim(x)或trimEnd(x)或trimStart(x)使用不规范,不支持参数替换;请调整为trimChar(x)或trimEndChar(xx)或trimStartChar(xx)');
|
|
169
169
|
var list = trimErrDatas[filePath];
|
|
170
170
|
if (list) trimErrDatas[filePath] = list.concat(infoList); // 记录该js有异常
|
|
171
171
|
else trimErrDatas[filePath] = infoList;
|
package/tool/merge/mergeTool.js
CHANGED
|
@@ -196,9 +196,9 @@ function checkFileCache(stats1, filePath, options) {
|
|
|
196
196
|
|
|
197
197
|
var stats2 = fs.statSync(cachePath);
|
|
198
198
|
if (stats1.mtime.getTime() - stats2.mtime.getTime() != 0) { // 比较时间,文件发生变动了
|
|
199
|
-
utils.
|
|
200
|
-
utils.
|
|
201
|
-
utils.
|
|
199
|
+
utils.debug('文件已更新:' + cachePath);
|
|
200
|
+
utils.debug(stats1.mtime);
|
|
201
|
+
utils.debug(stats2.mtime);
|
|
202
202
|
return false;
|
|
203
203
|
}
|
|
204
204
|
|
|
@@ -208,7 +208,7 @@ function checkFileCache(stats1, filePath, options) {
|
|
|
208
208
|
function writeCacheFile(filePath, options) {
|
|
209
209
|
var cachePath = getCachePath2(filePath);
|
|
210
210
|
if (!fs.existsSync(cachePath)) {
|
|
211
|
-
utils.
|
|
211
|
+
utils.debug("缓存文件不存在");
|
|
212
212
|
return false;
|
|
213
213
|
}
|
|
214
214
|
|
|
@@ -250,7 +250,7 @@ function compressFile(filePath, options, filePath2) {
|
|
|
250
250
|
options.__filesContent.push('// ' + p.split(path.sep).splice(-3).join(path.sep));
|
|
251
251
|
}
|
|
252
252
|
options.__filesContent.push(content);
|
|
253
|
-
utils.
|
|
253
|
+
utils.debug('文件打包完成:' + filePath + '\r\n');
|
|
254
254
|
}
|
|
255
255
|
|
|
256
256
|
|