Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const assertSuccess = <a>(parser: parser.Parser, input: string, expected: A) => {
const result = parser(stream.stream(input.split('')))
if (isRight(result)) {
assert.deepStrictEqual(result.right.value, expected)
} else {
throw new Error(`${result} is not a right`)
}
}
</a>