UNPKG

503 BJavaScriptView Raw
1'use strict'
2const t = require('typical')
3const option = require('./option')
4const reBeginsWithValueMarker = new RegExp('^' + option.VALUE_MARKER)
5
6class 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
18module.exports = ValueArg