How to use the @govuk-pay/pay-js-commons.removeIndefiniteArticles function in @govuk-pay/pay-js-commons

To help you get started, we’ve selected a few @govuk-pay/pay-js-commons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alphagov / pay-selfservice / app / browsered / nice-url.js View on Github external
function niceURL (e) {
    const input = e.target
    // stripping out the (in)definite article (the/a/an) and replacing spaces and other chars with a hyphen
    input.value = removeIndefiniteArticles(input.value).replace(/[\s£&$*_+~.()'"!:@]+/g, '-').toLowerCase()
  }
}