code: function parseInteger (value) {
    if (/^[-+]?[0-9]+$/.test(value)) {
      return parseInt(value, 10)
    }
  
    // "yes" and "no" are not integers but are supported by browsers.
    if (/^yes$/i.test(value)) {
      return 1
    }
    if (/^no$/i.test(value)) {
      return 0
    }
  
    return null
  }
docs: https://html.spec.whatwg.org/multipage/infrastructure.html#rules-for-parsing-integers