1 |
|
2 | const t = require('typical')
|
3 | const option = require('./option')
|
4 | const reBeginsWithValueMarker = new RegExp('^' + option.VALUE_MARKER)
|
5 |
|
6 | class ValueArg {
|
7 | constructor (value) {
|
8 | this.isOptionValueNotationValue = reBeginsWithValueMarker.test(value)
|
9 | /* if the value marker is present at the value beginning, strip it */
|
10 | this.value = value ? value.replace(reBeginsWithValueMarker, '') : value
|
11 | }
|
12 |
|
13 | isDefined () {
|
14 | return t.isDefined(this.value)
|
15 | }
|
16 | }
|
17 |
|
18 | module.exports = ValueArg
|