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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crabatool",
3
- "version": "1.0.340",
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": "^0.1.2",
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 = /\.trimEnd\(([^,)]+)\)|\.trimEnd\(['"],['"]\)|\.trimStart\(([^,)]+)\)|\.trimStart\(['"],['"]\)/g;
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(xx)或trimStart(xx)使用不规范,不支持参数替换;请调整为trimEndChar(xx)或trimStartChar(xx)');
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;
@@ -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.log('文件已更新:' + cachePath);
200
- utils.log(stats1.mtime);
201
- utils.log(stats2.mtime);
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.log("缓存文件不存在");
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.log('文件打包完成:' + filePath + '\r\n');
253
+ utils.debug('文件打包完成:' + filePath + '\r\n');
254
254
  }
255
255
 
256
256