ssh-config
Advanced tools
Comparing version 4.0.1 to 4.0.2
@@ -0,1 +1,7 @@ | ||
4.0.2 / 2020-02-09 | ||
================== | ||
* fix: 'compute' fails when hosts contain regex chars #34 @roblourens | ||
4.0.1 / 2020-02-01 | ||
@@ -2,0 +8,0 @@ ================== |
{ | ||
"name": "ssh-config", | ||
"description": "SSH config parser and stringifier", | ||
"version": "4.0.1", | ||
"version": "4.0.2", | ||
"author": "Chen Yangjian (https://www.cyj.me)", | ||
@@ -6,0 +6,0 @@ "repository": { |
'use strict' | ||
function escapeChars(str, chars) { | ||
for (let char of chars) { | ||
str = str.replace(new RegExp('\\' + char, 'g'), '\\' + char) | ||
} | ||
return str | ||
} | ||
function match(pattern, str) { | ||
pattern = escapeChars(pattern, '\\()[]{}.+^$|'); | ||
pattern = pattern | ||
.replace(/\./g, '\\.') | ||
.replace(/\+/g, '\\+') | ||
.replace(/\*/g, '.*') | ||
@@ -8,0 +15,0 @@ .replace(/\?/g, '.?') |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18761
356