gcanti / fp-ts-routing

A type-safe bidirectional routing library for TypeScript

Home Page:https://gcanti.github.io/fp-ts-routing/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Leading slashes

OliverJAsh opened this issue · comments

This returns Some. Should it return None?

import * as O from "fp-ts/Option";
import * as P from "fp-ts-routing";
import { pipe } from "fp-ts/lib/function";

const parser = pipe(P.lit("foo").parser, P.map(O.some));

const result = P.parse(parser, P.Route.parse("/////foo"), O.none);

console.log({ result });

#70 seems to have resolved this issue.

The fix will be available with version 0.6