How to use the io-ts-types/lib/NonEmptyString.NonEmptyString.is function in io-ts-types

To help you get started, we’ve selected a few io-ts-types 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 gcanti / hyper-ts / examples / authentication.ts View on Github external
return new Middleware(c => {
    // dummy authentication logic
    if (NonEmptyString.is(c.getHeader('token'))) {
      return middleware.run(c) as any
    } else {
      return fromLeft(AuthenticationError)
    }
  })
}