Skip to content

Commit 6d2a1ac

Browse files
fix: correct flags regex to match server and docs (#147)
* fix: adjust flag regex to match docs Co-authored-by: Joe Becher <[email protected]>
1 parent 827e0cb commit 6d2a1ac

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ jobs:
190190
name: Run Linux binary (upload)
191191
command: |
192192
out/codecov-linux -F linux -Z -e CIRCLE_BRANCH
193+
out/codecov-linux -F "-linux" -Z -e CIRCLE_BRANCH
193194
194195
- persist_to_workspace:
195196
root: .

src/helpers/validate.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ function validateURL(url) {
99
}
1010

1111
function validateFlags(flags) {
12-
const mask = /^(?!-)[\w,-]+$/
12+
const mask = /^[\w\.\-]{1,45}$/
1313
return mask.test(flags)
1414
}
1515

test/helpers/validate.test.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,12 @@ describe('Input Validators', () => {
3030
expect(validate.validateFlags('moo-foor')).toBe(true)
3131
})
3232

33-
it('Should fail with a dash at the start', () => {
34-
expect(validate.validateFlags('-moo-foor')).toBe(false)
33+
it('Should pass with a period in the middle', () => {
34+
expect(validate.validateFlags('moo.foor')).toBe(true)
35+
})
36+
37+
it('Should pass with a dash at the start', () => {
38+
expect(validate.validateFlags('-moo-foor')).toBe(true)
3539
})
3640
})
3741

0 commit comments

Comments
 (0)