@putout/plugin-remove-useless-escape 5.1.0 → 6.0.0

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.
@@ -101,6 +101,9 @@ function isEscaped(raw) {
101
101
  if (!raw.includes('\\'))
102
102
  return false;
103
103
 
104
+ if (raw.includes('\\h') && !raw.includes('\\\\h'))
105
+ return true;
106
+
104
107
  if (/\\\\/g.test(raw))
105
108
  return false;
106
109
 
@@ -110,6 +113,9 @@ function isEscaped(raw) {
110
113
  if (raw.includes('\\$'))
111
114
  return true;
112
115
 
116
+ if (raw.includes('\\.'))
117
+ return true;
118
+
113
119
  if (raw.includes('\\{'))
114
120
  return true;
115
121
 
@@ -139,7 +145,9 @@ function unEscape(raw) {
139
145
  .replaceAll('\\^', '^')
140
146
  .replaceAll('\\$', '$')
141
147
  .replaceAll('\\{', '{')
142
- .replace(/(\\),/, ',');
148
+ .replaceAll('\\.', '.')
149
+ .replace(/(\\),/, ',')
150
+ .replaceAll('\\h', 'h');
143
151
 
144
152
  for (const emoji of match(raw)) {
145
153
  raw = raw.replace(createEncodedRegExp(emoji), emoji);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@putout/plugin-remove-useless-escape",
3
- "version": "5.1.0",
3
+ "version": "6.0.0",
4
4
  "type": "commonjs",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "🐊Putout plugin adds ability to find and remove useless escape",
@@ -38,15 +38,15 @@
38
38
  "devDependencies": {
39
39
  "@putout/plugin-madrun": "*",
40
40
  "@putout/plugin-regexp": "*",
41
- "@putout/test": "^8.0.0",
42
- "c8": "^8.0.0",
43
- "eslint": "^8.0.1",
44
- "eslint-plugin-n": "^16.0.0",
41
+ "@putout/test": "^9.0.0",
42
+ "c8": "^9.0.0",
43
+ "eslint": "^9.0.0",
44
+ "eslint-plugin-n": "^17.0.0",
45
45
  "eslint-plugin-putout": "^22.0.0",
46
46
  "madrun": "^10.0.0"
47
47
  },
48
48
  "peerDependencies": {
49
- "putout": ">=34"
49
+ "putout": ">=35"
50
50
  },
51
51
  "license": "MIT",
52
52
  "engines": {