Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9e6c6f1

Browse files
committed
Escape back-slashes as part ofescapeString fn
1 parentd933b45 commit9e6c6f1

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

‎index.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function tokensToFunction (tokens) {
223223
*@return {string}
224224
*/
225225
functionescapeString(str){
226-
returnstr.replace(/([.+*?=^!:${}()[\]|\/])/g,'\\$1')
226+
returnstr.replace(/([.+*?=^!:${}()[\]|\/\\])/g,'\\$1')
227227
}
228228

229229
/**

‎test.ts‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,6 +1497,28 @@ var TESTS: Test[] = [
14971497
[{'0':'123'},'/123']
14981498
]
14991499
],
1500+
[
1501+
'/route\\(\\\\(\\d+\\\\)\\)',
1502+
null,
1503+
[
1504+
'/route(\\',
1505+
{
1506+
name:0,
1507+
prefix:'',
1508+
delimiter:'/',
1509+
optional:false,
1510+
repeat:false,
1511+
partial:false,
1512+
asterisk:false,
1513+
pattern:'\\d+\\\\'
1514+
},
1515+
')'
1516+
],
1517+
[
1518+
['/route(\\123\\)',['/route(\\123\\)','123\\']]
1519+
],
1520+
[]
1521+
],
15001522

15011523
/**
15021524
* Regexps.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp