Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsfix

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsfix - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

36

lib/map.js

@@ -12,3 +12,3 @@ function Deal(str) {

var src = this._src;
return src.slice(0, point) + src.slice(point + 1 + str.length);
return src.slice(0, point) + src.slice(point).replace(str, '');
},

@@ -103,7 +103,11 @@ update: function (point, str, newStr) {

"Unescaped '{a}'.": function (str, ch, a) {
return deal(str).insert(ch - 1, '\\');
var point = ch - 1;
if (a === '-') {
point = ch;
}
return deal(str).insert(point, '\\');
},
// 添加转义
"Unescaped '-'.": function (str, ch, a) {
return deal(str).insert(ch, '\\\\');
// 多余的转义
"Bad escapement.": function (str, ch) {
return deal(str).remove(ch - 2, '\\');
},

@@ -127,5 +131,25 @@ // 把表达式换成条件语句。

// 添加逗号后自动修复
"Line breaking error 'return'.": function (str, ch) {
"Line breaking error '{a}'.": function (str, ch, a) {
return str;
},
// TODO: 变量不可删除,注释掉代码
"Variables should not be deleted.": function () {
return false;
},
// TODO: 控制码
"Control character in string: {a}.": function () {
return false;
},
//for-in中变量加上声明
"Bad for in variable '{a}'.": function (str, ch, a) {
return deal(str).insert(ch - 1, 'var ');
},
// TODO: 使用array 字面量
"Use the array literal notation [].": function () {
return false;
},
// TODO: 使用array 字面量
"Use the object literal notation {}.": function () {
return false;
}
};

2

package.json

@@ -8,3 +8,3 @@ {

"description": "javascript fix base on jshint",
"version": "0.1.3",
"version": "0.1.4",
"main": "./lib/run.js",

@@ -11,0 +11,0 @@ "bin": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc