Skip to content

Commit 1f504f6

Browse files
committed
feat(main): add regExpFlag option
1 parent a97c11a commit 1f504f6

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

README.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,10 @@ link:https://github.com/isuke/git-consistent/blob/master/sample_type_list.adoc[s
346346
| (`type: branch` only) number of values to retrieve from the match specified by `regExp`
347347
| string
348348

349+
| `regExpFlag`
350+
| (`type: branch` only) `regExp`'s falg
351+
| `i`
352+
349353
| `rules`
350354
| input value format rules
351355
| Object

lib/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const getCurrentBranchName = () => {
6868

6969
const branchText = (_term, definition) => {
7070
const currentBranchName = getCurrentBranchName()
71-
const regExp = new RegExp(definition.regExp)
71+
const regExp = new RegExp(definition.regExp, definition.regExpFlag)
7272
const matchNum = definition.regExpMatchNum || 1
7373
const match = currentBranchName.match(regExp)
7474
const value = match ? match[matchNum] : ''

0 commit comments

Comments
 (0)