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
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Commitb54b05b

Browse files
committed
RemoveModifier Test
1 parent28ce8db commitb54b05b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

‎lib/Builder.js‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,8 @@ class Builder {
639639
*@return {Builder}
640640
*/
641641
removeModifier(flag){
642-
this._modifiers.replace(flag,'')
642+
this._modifiers=this._modifiers.replace(flag,'')
643+
this._result=null
643644

644645
returnthis
645646
}

‎test/builder-test.js‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
constassert=require('assert')
4-
constSRL=require('../lib/Builder')
4+
constSRL=require('../')
55

66
describe('Builder isMatching',()=>{
77
it('Simple Phone Number Format',()=>{
@@ -169,4 +169,13 @@ describe('Builder isMatching', () => {
169169
assert.ok(!regex.isMatching('fooa'))
170170
assert.ok(!regex.isMatching('foobar'))
171171
})
172+
173+
it('Remove modifier',()=>{
174+
constregex=newSRL()
175+
.literally('foo')
176+
.removeModifier('g')
177+
.get()
178+
179+
assert.deepEqual(regex,/(?:foo)/)
180+
})
172181
})

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp