diff --git a/builder/atlas/main.ts b/builder/atlas/main.ts new file mode 100644 index 0000000..f9c5c55 --- /dev/null +++ b/builder/atlas/main.ts @@ -0,0 +1,119 @@ +import { + ArrayFiler, + funRouterOptions, + ParamsMethod, + RequestFunction, + } from "../../types.ts"; + import badMethod from "../../components/util/badMethod.ts"; + import notFound from "../../components/util/notFound.ts"; + + type InnerObj = [string, RequestFunction] | []; + type InnerObjEmpty = [string, RequestFunction]; + type Map = Record>; + + export type Atlas = [ + ParamsMethod[], + number[][], + string[][][], + RequestFunction[], + ArrayFiler[1], + ]; + export default (_o?: funRouterOptions) => (a: ArrayFiler): Atlas => + ( + (am) => + ( + (ob) => + ( + (il) => + ( + (al) => + ( + (ul) => [am, il, al, ul, a[1]] + )( + il.map( + (x, i) => + x.map( + (y) => + ob[i][y].map( + (z) => [z[1]], + ), + ) as [RequestFunction][][], + ) + .flat(3) + .concat(a[1].map(([_, _a, x]) => x)) + .concat(notFound) + .concat(badMethod), + ) + )( + il.map( + (x, i) => + x.map( + (y) => ob[i][y].map((x) => x[0]), + ), + ) as string[][][], + ) + )( + Object.keys(ob) + .map((x) => Number(x)) + .map( + (x) => + Object + .keys(ob[Number(x)]) + .map((y) => Number(y)), + ) as [number[]], + ) + )( + Object.fromEntries( + am.map((x) => a[0].filter((y) => x === y[2])) + .map( + (x) => + ((p) => + Object.fromEntries( + p.map( + (y) => [ + y, + ( + (za) => + za[0][0] === "" + ? za + .slice(1) + .reduceRight( + (acc, z) => acc.concat([z]), + [za[0]], + ) + .reverse() + : za + )( + x + .reduce( + (acc, z) => + z[0] === y + ? [...acc, [z[1], z[3]]] as InnerObjEmpty[] + : acc, + [] as InnerObjEmpty[], + ), + ), + ], + ), + ))( + x.map((y) => y[0]) + .reduce( + (acc, y) => acc.includes(y) ? acc : acc.concat([y]), + [] as number[], + ) as number[], + ), + ) + .map( + (x, i) => [i, x], + ), + ) as Map, + ) + )( + a[0] + .reduce((acc: ParamsMethod[], am) => + acc + .includes(am[2]) + ? acc + : [...acc, am[2]], []) as ParamsMethod[], + ); + \ No newline at end of file diff --git a/builder/atlas/split.ts b/builder/atlas/split.ts new file mode 100644 index 0000000..ece68c7 --- /dev/null +++ b/builder/atlas/split.ts @@ -0,0 +1,23 @@ +import { + ArrayFiler, + funRouterOptions, + RouteTypes, + } from "../../types.ts"; + + export default (o?: funRouterOptions) => (a: RouteTypes[]): ArrayFiler => + ( + (fl) => + ( + (sp) => [ + fl.map ( + x => [x[1].split("/").length - 1,x[1],x[0],x[2]] + ) , + sp, + ] + )( + a.filter((x) => typeof x[3] === "string") as RouteTypes[], + ) + )( + a.filter((x) => x[3] === false), + ); + \ No newline at end of file diff --git a/builder/composer/methods.ts b/builder/composer/methods.ts new file mode 100644 index 0000000..df2108a --- /dev/null +++ b/builder/composer/methods.ts @@ -0,0 +1,32 @@ +import { funRouterOptions } from "../../types.ts"; +import { Atlas } from "../atlas.ts" +import parser from "./parser.ts" +import position from "../position.ts" + + +export default (o?:funRouterOptions) => (atlas:Atlas) => + ( + position => + atlas[0] + .map( + (_,i) => + o && "hasName" in o && typeof o.hasName === "string" + ? (p => (s:string) => p(s.slice(o!.hasName!.length -1)))(parser(o)(atlas[2][i])(position[i])(atlas[1][i])(atlas[3].length - 2)) + : ( p => + ( + n => + (s:string)=> n !== -1 ? p(s.slice(n)) : p(s.slice( + n = s + .split("/") + .filter((x) => x !== "") + .reduce((acc, x, u) => u <= 1 ? acc + x.length : acc, 3) - 1) ) + )( + -1 + ) + )( + parser(o)(atlas[2][i])(position[i])(atlas[1][i])(atlas[3].length - 2) + ) + ) as [(s:string) => number] + )( + position(o) (atlas[1])(atlas[2]) + ) \ No newline at end of file diff --git a/builder/composer/parser.ts b/builder/composer/parser.ts index 86990fe..3929ebd 100644 --- a/builder/composer/parser.ts +++ b/builder/composer/parser.ts @@ -22,7 +22,7 @@ export default (o?: funRouterOptions) => (sa:string[][]) =>(position: number[]) ], ).reverse().reduce((acc, v) => v[0] + acc + v[1], "") } -)`)() +)`)() as (s:string) => number )( an.reduce((acc, y) => y > acc ? y : acc, 0) ) diff --git a/builder/composer/specialString.ts b/builder/composer/specialString.ts new file mode 100644 index 0000000..f91fa66 --- /dev/null +++ b/builder/composer/specialString.ts @@ -0,0 +1,47 @@ + +import { funRouterOptions, RouteTypes } from "../../types.ts"; + +export default (o?: funRouterOptions) => (max: number) => (ar: RouteTypes[]) => + ( + (nar) => + ( + p => + ( + (f) => ( + fa =>(s:string) => fa(p(s)) + )( + f(nar) + ) + )( + (ar: string[]) => + (new Function(`return s=>${ + ar.reduceRight( + (acc, v, i) => `s.indexOf("${v}")===0?${i + max - 2}:` + acc, + "-1", + ) + }`))() as (s: string) => number, + ) + )( + o && "hasName" in o && typeof o.hasName === "string" + ? (s:string) => s.slice(o!.hasName!.length -1) + : + ( + n => + (s:string)=> n !== -1 ? s.slice(n) : s.slice( + n = s + .split("/") + .filter((x) => x !== "") + .reduce((acc, x, u) => u <= 1 ? acc + x.length : acc, 3) - 1) + )( + -1 + ) + + ) + )( + ar.map(([_, a]) => a) + .sort((a, b) => b.length - a.length), + ); + + + + diff --git a/builder/solver.ts b/builder/solver.ts new file mode 100644 index 0000000..d20b5d5 --- /dev/null +++ b/builder/solver.ts @@ -0,0 +1,39 @@ +import { funRouterOptions, Atlas, RouteTypes} from "../types.ts"; +import solver from "./composer/methods.ts" +import specialString from "./composer/specialString.ts"; + +export default + (o?:funRouterOptions) => + (atlas:Atlas) => ( + me => ( + solve => + atlas[4].length === 0 + ? (r:Request) => + me(r.method) !== -1 + ? solve[me(r.method)](r.url) + : atlas[3].length - 1 + : ( + (sc) => + (r: Request) => + ( + (w) => + w === -1 + ? + me(r.method) !== -1 + ? solve[me(r.method)](r.url) + : atlas[3].length - 1 + : w + )( + sc(r.url), + ) + )( + specialString({})(atlas[3].length - 1)( + atlas[4].map((x) => [x[0], x[3], x[2], x[1]] as RouteTypes), + ), + ) + )( + solver (o) (atlas) + ) + )( + ((a: string[]) => ((o) => (s: string) => o.indexOf(s[0]))(a.map((x) => x[0])))(atlas[0]) + ) \ No newline at end of file diff --git a/fun.ts b/fun.ts index 40824de..d695988 100644 --- a/fun.ts +++ b/fun.ts @@ -3,16 +3,18 @@ import { ObjectRawResponse } from "./optimizer/types.ts"; import optimizer from "./optimizer/optimize.ts"; import atlas from "./builder/atlas.ts"; import arraySwap from "./builder/arraySwap.ts"; -import resolver from "./builder/resolver.ts"; + +import solver from "./builder/solver.ts"; +import split from "./builder/atlas/split.ts"; export default (o?: funRouterOptions) => (routes: ObjectRawResponse[]) => ((re) => ((s) => (r: Request) => re[3][s(r)](r) )( - resolver(o)(re), + solver(o)(re), ))( atlas(o)( - arraySwap(o)( + split(o)( optimizer(o)(routes), ), ), diff --git a/optimizer/staticFiles.ts b/optimizer/staticFiles.ts index a5a3f8e..86a91bf 100644 --- a/optimizer/staticFiles.ts +++ b/optimizer/staticFiles.ts @@ -7,6 +7,9 @@ import resolver from "../builder/resolver.ts"; import staticPaths from "./staticPaths.ts"; import mime from "../components/util/mime.ts"; +import solver from "../builder/solver.ts"; +import split from "../builder/atlas/split.ts"; + export default (o?: funRouterOptions) => (f: ObjectRawResponseStatic): (r: Request) => Response | Promise => ((p) => @@ -14,10 +17,10 @@ export default (o?: funRouterOptions) => ( (s) => (r: Request) => re[3][s(r)](r) )( - resolver(o)(re), + solver(o)(re), ))( atlas(o)( - arraySwap(o)( + split(o)( staticPaths( "mime" in f && f.mime === false ? [] : "extra" in f ? mime.concat(f.extra): mime )(p)(f.name), ), ), diff --git a/test/builder/atlas/main.test.ts b/test/builder/atlas/main.test.ts new file mode 100644 index 0000000..6cf342e --- /dev/null +++ b/test/builder/atlas/main.test.ts @@ -0,0 +1,57 @@ +import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; +import atlas from "../../../builder/atlas.ts"; +import optimize from "../../../optimizer/optimize.ts"; +import paths from "../../util/paths.ts"; +import split from "../../../builder/atlas/split.ts" + +Deno.test( + "Atlas", + (_) => + assertEquals( + ((r) => [r[0], r[1], r[2]])( + atlas()(split()(optimize()(paths))), + ), + [ + [ + "GET", + "POST", + "HEAD", + "DELETE", + ], + [ + [ + 1, + 2, + 4, + ], + [ + 1, + ], + [ + 1, + ], + [ + 1, + ], + ], + [ + [ + ["/", "/test"], + ["/test/"], + ["/test/:id/:name/"], + ], + [ + ["/"], + ], + [ + ["/"], + ], + [ + ["/"], + ], + ], + ], + ), +); + + \ No newline at end of file diff --git a/test/builder/atlas/split.test.ts b/test/builder/atlas/split.test.ts new file mode 100644 index 0000000..a595930 --- /dev/null +++ b/test/builder/atlas/split.test.ts @@ -0,0 +1,40 @@ +import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; +import arraySwap from "../../../builder/arraySwap.ts"; +import paths from "../../util/paths.ts"; +import optimize from "../../../optimizer/optimize.ts"; +import { funRouterOptions } from "../../../types.ts"; +import split from "../../../builder/atlas/split.ts" + +Deno.test( + "arraySwap", + (_) => + assertEquals( + split({hasName: "http://localhost:8080/"})(optimize({hasName: "http://localhost:8080/"})(paths))[0].map((x) => [x[0], x[1], x[2]]), + [ + [1, "/", "GET"], + [1, "/test", "GET"], + [2, "/test/", "GET"], + [4, "/test/:id/:name/", "GET"], + [1, "/", "POST"], + [1, "/", "HEAD"], + [1, "/", "DELETE"], + ], + ), +); + +Deno.test( + "arraySwap", + (_) => + assertEquals( + split()(optimize()(paths))[0].map((x) => [x[0], x[1], x[2]]), + [ + [1, "/", "GET"], + [1, "/test", "GET"], + [2, "/test/", "GET"], + [4, "/test/:id/:name/", "GET"], + [1, "/", "POST"], + [1, "/", "HEAD"], + [1, "/", "DELETE"], + ], + ), +); \ No newline at end of file diff --git a/test/builder/composer/methods.test.ts b/test/builder/composer/methods.test.ts new file mode 100644 index 0000000..5c26ef5 --- /dev/null +++ b/test/builder/composer/methods.test.ts @@ -0,0 +1,90 @@ +import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; +import methods from "../../../builder/composer/methods.ts" +import split from "../../../builder/atlas/split.ts" +import paths from "../../util/paths.ts"; +import optimize from "../../../optimizer/optimize.ts"; +import atlas from "../../../builder/atlas.ts"; + + + +Deno.test( + "composer", + _ => + ( f=> + assertEquals( + [ + f[0]("http://localhost:8080/"), + f[0]("http://localhost:8080/test"), + f[0]("http://localhost:8080/test/") + ], + [0,1,2] + ) + )( + methods({hasName: "http://localhost:8080/"})( + [ + + [ + "GET", + ], + [ + [ + 1, + 2, + 4, + ], + ], + [ + [ + [ "/","/test"], + ["/test/"], + ["test/:id/:hi/"], + ], + ], + [], + [] + ], + + ) + ) +) + +Deno.test( + "composer", + _ => + ( f=> + assertEquals( + [ + f[0]("http://localhost:8080/"), + f[0]("http://localhost:8080/test"), + f[0]("http://localhost:8080/test/") + ], + [0,1,2] + ) + )( + methods({hasName: "http://localhost:8080/"})( + [ + + [ + "GET", + ], + [ + [ + 1, + 2, + 4, + ], + ], + [ + [ + [ "/","/test"], + ["/test/"], + ["test/:id/:hi/"], + ], + ], + [], + [] + ], + + ) + ) +) \ No newline at end of file diff --git a/test/builder/composer/parser.ts b/test/builder/composer/parser.test.ts similarity index 100% rename from test/builder/composer/parser.ts rename to test/builder/composer/parser.test.ts diff --git a/test/builder/composer/specialString.test.ts b/test/builder/composer/specialString.test.ts new file mode 100644 index 0000000..205d40a --- /dev/null +++ b/test/builder/composer/specialString.test.ts @@ -0,0 +1,14 @@ +import specialString from "../../../builder/composer/specialString.ts" +import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; + + + +Deno.test( + "hello", + _ => assertEquals( + specialString({hasName: "http://localhost:8080/"})(12)([ + ["GET","/",_ => new Response(),false] + ])("http://localhost:8080/"), + null + ) +) \ No newline at end of file diff --git a/test/builder/resolver.test.ts b/test/builder/resolver.test.ts index 36085d9..d2fb76b 100644 --- a/test/builder/resolver.test.ts +++ b/test/builder/resolver.test.ts @@ -1,32 +1,32 @@ -import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; -import resolver from "../../builder/resolver.ts"; -import atlas from "../../builder/atlas.ts"; -import paths from "../util/paths.ts"; -import arraySwap from "../../builder/arraySwap.ts"; -import optimize from "../../optimizer/optimize.ts"; +// import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; +// import resolver from "../../builder/resolver.ts"; +// import atlas from "../../builder/atlas.ts"; +// import paths from "../util/paths.ts"; +// import arraySwap from "../../builder/arraySwap.ts"; +// import optimize from "../../optimizer/optimize.ts"; -Deno.test( - "resolver", - _ => - ( - a => - assertEquals( - [ - a(new Request("http://localhost:8080/notFound/")), - a(new Request("http://localhost:8080/test")), - a(new Request("http://localhost:8080/")), - a(new Request("http://localhost:8080/test/2")) - ], - [ - 7, - 0, - 1, - 2 - ], - ) +// Deno.test( +// "resolver", +// _ => +// ( +// a => +// assertEquals( +// [ +// a(new Request("http://localhost:8080/notFound/")), +// a(new Request("http://localhost:8080/test")), +// a(new Request("http://localhost:8080/")), +// a(new Request("http://localhost:8080/test/2")) +// ], +// [ +// 7, +// 0, +// 1, +// 2 +// ], +// ) - )( - resolver()(atlas()(arraySwap()(optimize()(paths)))), - ) -) +// )( +// resolver()(atlas()(arraySwap()(optimize()(paths)))), +// ) +// ) diff --git a/test/builder/sResolver.test.ts b/test/builder/sResolver.test.ts index 2ba3d9f..330b030 100644 --- a/test/builder/sResolver.test.ts +++ b/test/builder/sResolver.test.ts @@ -1,19 +1,19 @@ -import sResolver from "../../builder/sResolver.ts" -import url from "../util/url.ts" -import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; +// import sResolver from "../../builder/sResolver.ts" +// import url from "../util/url.ts" +// import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; -Deno.test( - "hello", _ => - assertEquals( - sResolver(url)[0][0](""), - 1 - ) -) +// // Deno.test( +// // "hello", _ => +// // assertEquals( +// // sResolver(url)[0][0](""), +// // 1 +// // ) +// // ) -Deno.test( - "hello", _ => - assertEquals( - sResolver(url)[0][0]("test/"), - 0 - ) -) +// Deno.test( +// "hello", _ => +// assertEquals( +// sResolver(url)[0][0]("test/"), +// 0 +// ) +// ) diff --git a/test/builder/solver.test.ts b/test/builder/solver.test.ts new file mode 100644 index 0000000..6a662bf --- /dev/null +++ b/test/builder/solver.test.ts @@ -0,0 +1,59 @@ +import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; +import solver from "../../builder/solver.ts"; +import atlas from "../../builder/atlas.ts"; +import paths from "../util/paths.ts"; +import split from "../../builder/atlas/split.ts"; +import optimize from "../../optimizer/optimize.ts"; + +Deno.test( + "resolver", + _ => + ( + a => + assertEquals( + [ + a(new Request("http://localhost:8080/notFound/")), + a(new Request("http://localhost:8080/test")), + a(new Request("http://localhost:8080/")), + a(new Request("http://localhost:8080/test/2")) + ], + [ + 7, + 1, + 0, + 2 + ] + , + ) + + )( + solver({hasName:"http://localhost:8080/"})(atlas({hasName:"http://localhost:8080/"})(split({hasName:"http://localhost:8080/"})(optimize({hasName:"http://localhost:8080/"})(paths)))), + ) +) + +Deno.test( + "resolver", + _ => + ( + a => + assertEquals( + [ + a(new Request("http://localhost:8080/notFound/")), + a(new Request("http://localhost:8080/test")), + a(new Request("http://localhost:8080/")), + a(new Request("http://localhost:8080/test/2")) + ], + [ + 7, + 1, + 0, + 2 + ] + , + ) + + )( + solver()(atlas()(split()(optimize()(paths)))), + ) + ) + \ No newline at end of file diff --git a/test/builder/stringParser.test.ts b/test/builder/stringParser.test.ts index b72e6eb..373fe44 100644 --- a/test/builder/stringParser.test.ts +++ b/test/builder/stringParser.test.ts @@ -1,166 +1,166 @@ -import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; -import stringParser from "../../builder/stringParser.ts"; -import arraySwap from "../../builder/arraySwap.ts"; -import atlas from "../../builder/atlas.ts"; -import optimize from "../../optimizer/optimize.ts"; -import paths from "../util/paths.ts"; -import { funRouterOptions } from "../../types.ts"; +// import { assertEquals } from "https://deno.land/std@0.160.0/testing/asserts.ts"; +// import stringParser from "../../builder/stringParser.ts"; +// import arraySwap from "../../builder/arraySwap.ts"; +// import atlas from "../../builder/atlas.ts"; +// import optimize from "../../optimizer/optimize.ts"; +// import paths from "../util/paths.ts"; +// import { funRouterOptions } from "../../types.ts"; -Deno.test( - "StringParser", - (_) => - ( - (r) => - assertEquals( - stringParser()(r[1])("http://localhost:8080/"), - [1, ""], - ) - )( - atlas()(arraySwap()(optimize()(paths))), - ), -); -Deno.test( - "StringParser", - (_) => - ( - (o: funRouterOptions) => - ( - (r) => - assertEquals( - stringParser(o)(r[1])("http://localhost:8080/"), - [1, ""], - ) - )( - atlas(o)(arraySwap(o)(optimize(o)(paths))), - ) - )( - {} - ), -); -Deno.test( - "StringParser", - (_) => - ( - (o: funRouterOptions) => - ( - (r) => - assertEquals( - stringParser(o)(r[1])("http://localhost:8080/"), - [1, ""], - ) - )( - atlas(o)(arraySwap(o)(optimize(o)(paths))), - ) - )( - { hasName: "http://localhost:8080/" }, - ), -); -Deno.test( - "StringParser", - (_) => - ( - (o: funRouterOptions) => - ( - (r) => - assertEquals( - stringParser()(r[1])("http://localhost:8080/hello"), - [1, "hello"], - ) - )( - atlas(o)(arraySwap(o)(optimize(o)(paths))), - ) - )( - {}, - ), -); -Deno.test( - "StringParser", - (_) => - ( - (o: funRouterOptions) => - ( - (r) => - assertEquals( - stringParser()(r[1])("http://localhost:8080/hello"), - [1, "hello"], - ) - )( - atlas(o)(arraySwap(o)(optimize(o)(paths))), - ) - )( - { hasName: "http://localhost:8080/hello" }, - ), -); -Deno.test( - "StringParser", - (_) => - ( - (o: funRouterOptions) => - ( - (r) => - assertEquals( - stringParser()(r[1])("http://localhost:8080/hello"), - [1, "hello"], - ) - )( - atlas(o)(arraySwap(o)(optimize(o)(paths))), - ) - )( - {}, - ), -); -Deno.test( - "StringParser", - (_) => - ( - (o: funRouterOptions) => - ( - (r) => - assertEquals( - stringParser(o)(r[1])("http://localhost:8080/test/id/num/"), - [4, "test/id/num/"], - ) - )( - atlas(o)(arraySwap(o)(optimize(o)(paths))), - ) - )( - {}, - ), -); -Deno.test( - "StringParser", - (_) => - ( - (o: funRouterOptions) => - ( - (r) => - assertEquals( - stringParser(o)(r[1])("http://localhost:8080/test/id/num/"), - [4, "test/id/num/"], - ) - )( - atlas(o)(arraySwap(o)(optimize(o)(paths))), - ) - )( - {}, - ), -); +// Deno.test( +// "StringParser", +// (_) => +// ( +// (r) => +// assertEquals( +// stringParser()(r[1])("http://localhost:8080/"), +// [1, ""], +// ) +// )( +// atlas()(arraySwap()(optimize()(paths))), +// ), +// ); +// Deno.test( +// "StringParser", +// (_) => +// ( +// (o: funRouterOptions) => +// ( +// (r) => +// assertEquals( +// stringParser(o)(r[1])("http://localhost:8080/"), +// [1, ""], +// ) +// )( +// atlas(o)(arraySwap(o)(optimize(o)(paths))), +// ) +// )( +// {} +// ), +// ); +// Deno.test( +// "StringParser", +// (_) => +// ( +// (o: funRouterOptions) => +// ( +// (r) => +// assertEquals( +// stringParser(o)(r[1])("http://localhost:8080/"), +// [1, ""], +// ) +// )( +// atlas(o)(arraySwap(o)(optimize(o)(paths))), +// ) +// )( +// { hasName: "http://localhost:8080/" }, +// ), +// ); +// Deno.test( +// "StringParser", +// (_) => +// ( +// (o: funRouterOptions) => +// ( +// (r) => +// assertEquals( +// stringParser()(r[1])("http://localhost:8080/hello"), +// [1, "hello"], +// ) +// )( +// atlas(o)(arraySwap(o)(optimize(o)(paths))), +// ) +// )( +// {}, +// ), +// ); +// Deno.test( +// "StringParser", +// (_) => +// ( +// (o: funRouterOptions) => +// ( +// (r) => +// assertEquals( +// stringParser()(r[1])("http://localhost:8080/hello"), +// [1, "hello"], +// ) +// )( +// atlas(o)(arraySwap(o)(optimize(o)(paths))), +// ) +// )( +// { hasName: "http://localhost:8080/hello" }, +// ), +// ); +// Deno.test( +// "StringParser", +// (_) => +// ( +// (o: funRouterOptions) => +// ( +// (r) => +// assertEquals( +// stringParser()(r[1])("http://localhost:8080/hello"), +// [1, "hello"], +// ) +// )( +// atlas(o)(arraySwap(o)(optimize(o)(paths))), +// ) +// )( +// {}, +// ), +// ); +// Deno.test( +// "StringParser", +// (_) => +// ( +// (o: funRouterOptions) => +// ( +// (r) => +// assertEquals( +// stringParser(o)(r[1])("http://localhost:8080/test/id/num/"), +// [4, "test/id/num/"], +// ) +// )( +// atlas(o)(arraySwap(o)(optimize(o)(paths))), +// ) +// )( +// {}, +// ), +// ); +// Deno.test( +// "StringParser", +// (_) => +// ( +// (o: funRouterOptions) => +// ( +// (r) => +// assertEquals( +// stringParser(o)(r[1])("http://localhost:8080/test/id/num/"), +// [4, "test/id/num/"], +// ) +// )( +// atlas(o)(arraySwap(o)(optimize(o)(paths))), +// ) +// )( +// {}, +// ), +// ); -Deno.test( - "StringParser", - (_) => - ( - (o: funRouterOptions) => - ( - (r) => - assertEquals( - stringParser(o)(r[1])("http://localhost:8080/test/id/num/"), - [4, "test/id/num/"], - ) - )( - atlas(o)(arraySwap(o)(optimize(o)(paths))), - ) - )( - { hasName: "http://localhost:8080/" }, - ), -); +// Deno.test( +// "StringParser", +// (_) => +// ( +// (o: funRouterOptions) => +// ( +// (r) => +// assertEquals( +// stringParser(o)(r[1])("http://localhost:8080/test/id/num/"), +// [4, "test/id/num/"], +// ) +// )( +// atlas(o)(arraySwap(o)(optimize(o)(paths))), +// ) +// )( +// { hasName: "http://localhost:8080/" }, +// ), +// );