diff --git a/dist/Router.d.ts b/dist/Router.d.ts index a3d78f9..70a7bf2 100644 --- a/dist/Router.d.ts +++ b/dist/Router.d.ts @@ -1,5 +1,5 @@ -import { type Matched, type Matcher } from './matchers'; -import { type MatchResult, type MatchResultAny } from './matchers/MatchResult'; +import { type Matched, type Matcher } from './matchers/index.js'; +import { type MatchResult, type MatchResultAny } from './matchers/MatchResult.js'; interface HandlerParams { match: Matched; data: D; diff --git a/dist/Router.js b/dist/Router.js index 891c49d..71ddd99 100644 --- a/dist/Router.js +++ b/dist/Router.js @@ -1,5 +1,5 @@ -import { isMatched, } from './matchers'; -import {} from './matchers/MatchResult'; +import { isMatched, } from './matchers/index.js'; +import {} from './matchers/MatchResult.js'; export class Router { constructor(defaultHandler) { this.defaultHandler = defaultHandler; diff --git a/dist/Router.js.map b/dist/Router.js.map index 2669cfa..e77d997 100644 --- a/dist/Router.js.map +++ b/dist/Router.js.map @@ -1 +1 @@ -{"version":3,"file":"Router.js","sourceRoot":"","sources":["../src/Router.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,SAAS,GACT,MAAM,YAAY,CAAA;AACnB,OAAO,EAGN,MAAM,wBAAwB,CAAA;AAqB/B,MAAM,OAAO,MAAM;IAGlB,YAAoB,cAAiD;QAAjD,mBAAc,GAAd,cAAc,CAAmC;QAF7D,WAAM,GAA+B,EAAE,CAAA;QAG9C,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QACxC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;IAED,QAAQ,CAA4B,KAAmB;QACtD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAA4C,CAAC,CAAA;IAC/D,CAAC;IAED,8DAA8D;IAC9D,IAAI,CAAC,MAAS;;QACb,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACjC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C;oBACpB,KAAK;oBACL,IAAI,EAAE,MAAM;iBACZ,CAAC,CAAA;YACH,CAAC;QACF,CAAC;QACD,OAAO,MAAA,IAAI,CAAC,cAAc,qDAAG;YAC5B,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE;YAC3C,IAAI,EAAE,MAAM;SACZ,CAAC,CAAA;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/dist/__tests__/Router.test.js b/dist/__tests__/Router.test.js index 2e45d54..e79e49a 100644 --- a/dist/__tests__/Router.test.js +++ b/dist/__tests__/Router.test.js @@ -1,9 +1,9 @@ import { createRequest, createResponse, } from 'node-mocks-http'; import { compile, pathToRegexp, } from 'path-to-regexp'; -import { Router, } from '../Router'; -import { EndpointMatcher, ExactUrlPathnameMatcher, MethodMatcher, RegExpUrlMatcher, and, } from '../matchers'; -import { BooleanMatcher, } from '../matchers/BooleanMatcher'; -import { NodeHttpRouter, } from '../node/NodeHttpRouter'; +import { Router, } from '../Router.js'; +import { EndpointMatcher, ExactUrlPathnameMatcher, MethodMatcher, RegExpUrlMatcher, and, } from '../matchers/index.js'; +import { BooleanMatcher, } from '../matchers/BooleanMatcher.js'; +import { NodeHttpRouter, } from '../node/NodeHttpRouter.js'; let router; beforeEach(() => { router = new Router(); diff --git a/dist/__tests__/Router.test.js.map b/dist/__tests__/Router.test.js.map index cd66152..6d766db 100644 --- a/dist/__tests__/Router.test.js.map +++ b/dist/__tests__/Router.test.js.map @@ -1 +1 @@ -{"version":3,"file":"Router.test.js","sourceRoot":"","sources":["../../src/__tests__/Router.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EACb,cAAc,GACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,OAAO,EACP,YAAY,GACZ,MAAM,gBAAgB,CAAA;AAIvB,OAAO,EAEN,MAAM,GACN,MAAM,WAAW,CAAA;AAClB,OAAO,EAEN,eAAe,EAEf,uBAAuB,EAIvB,aAAa,EACb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EAAE;YACR,KAAK,CAAC,MAAe;;gBACpB,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;gBACpD,IAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,GAAG,EAAE,CAAC;oBACzB,OAAO;wBACN,OAAO,EAAE,IAAI;wBACb,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC;qBACvC,CAAA;gBACF,CAAC;gBACD,OAAO;oBACN,OAAO,EAAE,KAAK;iBACd,CAAA;YACF,CAAC;SACD;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE;YAClC,OAAO,aAAa,IAAI,CAAC,IAAI,eAAe,MAAM,EAAE,CAAA;QACrD,CAAC;KACD,CAAC,CAAA;IAEF,WAAW,CAAC,QAAQ,CAAC;QACpB,OAAO,EAAE,IAAI,cAAc,CAAC,IAAI,CAAC;QACjC,OAAO,CAAC,EAAE,IAAI,EAAE;YACf,OAAO,cAAc,IAAI,CAAC,IAAI,cAAc,CAAA;QAC7C,CAAC;KACD,CAAC,CAAA;IAEF,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,OAAO;KACb,CAAC,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAA;IAExC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,SAAS;KACf,CAAC,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAA;AAC3C,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"Router.test.js","sourceRoot":"","sources":["../../src/__tests__/Router.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EACb,cAAc,GACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,OAAO,EACP,YAAY,GACZ,MAAM,gBAAgB,CAAA;AA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G,EAAE;IAS3B,MAAM,WAAW,GAAG,IAAI,MAAM,EAAW,CAAA;IAEzC,WAAW,CAAC,QAAQ,CAAC;QACpB,OAAO,EAAE;YACR,KAAK,CAAC,MAAe;;gBACpB,MAAM,MAAM,GAAG,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;gBACpD,IAAI,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAAM,0CAAE,GAAG,EAAE,CAAC;oBACzB,OAAO;wBACN,OAAO,EAAE,IAAI;wBACb,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,EAAE,CAAC;qBACvC,CAAA;gBACF,CAAC;gBACD,OAAO;oBACN,OAAO,EAAE,KAAK;iBACd,CAAA;YACF,CAAC;SACD;QACD,OAAO,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,MAAM,EAAE,EAAE;YAClC,OAAO,aAAa,IAAI,CAAC,IAAI,eAAe,MAAM,EAAE,CAAA;QACrD,CAAC;KACD,CAAC,CAAA;IAEF,WAAW,CAAC,QAAQ,CAAC;QACpB,OAAO,EAAE,IAAI,cAAc,CAAC,IAAI,CAAC;QACjC,OAAO,CAAC,EAAE,IAAI,EAAE;YACf,OAAO,cAAc,IAAI,CAAC,IAAI,cAAc,CAAA;QAC7C,CAAC;KACD,CAAC,CAAA;IAEF,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,OAAO;KACb,CAAC,CAAC,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAA;IAExC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,SAAS;KACf,CAAC,CAAC,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAA;AAC3C,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/examples/micro.js b/dist/examples/micro.js index c78a98d..cc9fd45 100644 --- a/dist/examples/micro.js +++ b/dist/examples/micro.js @@ -1,8 +1,8 @@ import http from 'http'; import { send, serve, } from 'micro'; -import { EndpointMatcher, ExactUrlPathnameMatcher, } from '../matchers'; -import { BooleanMatcher, } from '../matchers/BooleanMatcher'; -import { NodeHttpRouter, } from '../node/NodeHttpRouter'; +import { EndpointMatcher, ExactUrlPathnameMatcher, } from '../matchers/index.js'; +import { BooleanMatcher, } from '../matchers/BooleanMatcher.js'; +import { NodeHttpRouter, } from '../node/NodeHttpRouter.js'; /* Demo how to use router with micro@canary diff --git a/dist/examples/micro.js.map b/dist/examples/micro.js.map index 95ad543..c06d524 100644 --- a/dist/examples/micro.js.map +++ b/dist/examples/micro.js.map @@ -1 +1 @@ -{"version":3,"file":"micro.js","sourceRoot":"","sources":["../../src/examples/micro.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACN,IAAI,EACJ,KAAK,GACL,MAAM,OAAO,CAAA;AACd,OAAO,EACN,eAAe,EACf,uBAAuB,GACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EACN,cAAc,GACd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACN,cAAc,GACd,MAAM,wBAAwB,CAAA;AAE/B;;;;;;;;;;EAUE;AAEF,MAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAA;AAEnC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;AAE3C,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AAC3E,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;IAC7B,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,IAAI,IAAI,EAAE,CAAC,CAAA;AACpD,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,QAAQ,CAAC;IACf,uEAAuE;IACvE,OAAO,EAAE,IAAI,eAAe,CAAmB,KAAK,EAAE,2BAA2B,CAAC;IAClF,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACtB,OAAO,SAAS,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,CAAA;IAClD,CAAC;CACD,CAAC,CAAA;AAEF,MAAM,CAAC,QAAQ,CAAC;IACf,OAAO,EAAE,IAAI,uBAAuB,CAAC,CAAC,WAAW,CAAC,CAAC;IACnD,OAAO,EAAE,GAAG,EAAE;QACb,MAAM,CAAC,KAAK,EAAE,CAAA;QACd,OAAO,qBAAqB,CAAA;IAC7B,CAAC;CACD,CAAC,CAAA;AAEF,cAAc;AACd,MAAM,CAAC,QAAQ,CAAC;IACf,OAAO,EAAE,IAAI,cAAc,CAAC,IAAI,CAAC;IACjC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;CAC9C,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"micro.js","sourceRoot":"","sources":["../../src/examples/micro.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACN,IAAI,EACJ,KAAK,GACL,MAAM,OAAO,CAAA;AACd,OAAO,EACN,eAAe,EACf,uBAAuB,GACvB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACN,cAAc,GACd,MAAM,+BAA+B,CAAA;AACtC,OAAO,EACN,cAAc,GACd,MAAM,2BAA2B,CAAA;AAElC;;;;;;;;;;EAUE;AAEF,MAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAA;AAEnC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;AAE3C,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AAC3E,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;IAC7B,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,IAAI,IAAI,EAAE,CAAC,CAAA;AACpD,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,QAAQ,CAAC;IACf,uEAAuE;IACvE,OAAO,EAAE,IAAI,eAAe,CAAmB,KAAK,EAAE,2BAA2B,CAAC;IAClF,OAAO,EAAE,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;QACtB,OAAO,SAAS,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,CAAA;IAClD,CAAC;CACD,CAAC,CAAA;AAEF,MAAM,CAAC,QAAQ,CAAC;IACf,OAAO,EAAE,IAAI,uBAAuB,CAAC,CAAC,WAAW,CAAC,CAAC;IACnD,OAAO,EAAE,GAAG,EAAE;QACb,MAAM,CAAC,KAAK,EAAE,CAAA;QACd,OAAO,qBAAqB,CAAA;IAC7B,CAAC;CACD,CAAC,CAAA;AAEF,cAAc;AACd,MAAM,CAAC,QAAQ,CAAC;IACf,OAAO,EAAE,IAAI,cAAc,CAAC,IAAI,CAAC;IACjC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC;CAC9C,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/examples/node.js b/dist/examples/node.js index 9e10ccc..5c322bc 100644 --- a/dist/examples/node.js +++ b/dist/examples/node.js @@ -1,7 +1,7 @@ import http from 'http'; -import { EndpointMatcher, ExactUrlPathnameMatcher, } from '../matchers'; -import { BooleanMatcher, } from '../matchers/BooleanMatcher'; -import { NodeHttpRouter, } from '../node/NodeHttpRouter'; +import { EndpointMatcher, ExactUrlPathnameMatcher, } from '../matchers/index.js'; +import { BooleanMatcher, } from '../matchers/BooleanMatcher.js'; +import { NodeHttpRouter, } from '../node/NodeHttpRouter.js'; /* Demo how to use router with native node native http server diff --git a/dist/examples/node.js.map b/dist/examples/node.js.map index ba0eaad..61b153f 100644 --- a/dist/examples/node.js.map +++ b/dist/examples/node.js.map @@ -1 +1 @@ -{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/examples/node.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACN,eAAe,EACf,uBAAuB,GACvB,MAAM,aAAa,CAAA;AACpB,OAAO,EACN,cAAc,GACd,MAAM,4BAA4B,CAAA;AACnC,OAAO,EACN,cAAc,GACd,MAAM,wBAAwB,CAAA;AAE/B;;;;;;;;;;EAUE;AAEF,MAAM,MAAM,GAAG,IAAI,cAAc,EAAE,CAAA;AAEnC,MAAM,CAAC,OAAO,EAAE,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;AAE3C,MAAM,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AACpE,MAAM,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,EAAE;IAC7B,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,IAAI,IAAI,EAAE,CAAC,CAAA;AACpD,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,QAAQ,CAAC;IACf,uEAAuE;IACvE,OAAO,EAAE,IAAI,eAAe,CAAmB,KAAK,EAAE,2BAA2B,CAAC;IAClF,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACrC,GAAG,CAAC,KAAK,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAA;QAC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AC,WAAW,EAAE,GAAG,EAAE;IAC7B,sCAAsC;IACtC,OAAO,CAAC,GAAG,CAAC,qBAAqB,OAAO,IAAI,IAAI,EAAE,CAAC,CAAA;AACpD,CAAC,CAAC,CAAA;AAEF,MAAM,CAAC,QAAQ,CAAC;IACf,uEAAuE;IACvE,OAAO,EAAE,IAAI,eAAe,CAAmB,KAAK,EAAE,2BAA2B,CAAC;IAClF,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE;QACrC,GAAG,CAAC,KAAK,CAAC,SAAS,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,GAAG,CAAC,CAAA;QACrD,GAAG,CAAC,GAAG,EAAE,CAAA;IACV,CAAC;CACD,CAAC,CAAA;AAEF,MAAM,CAAC,QAAQ,CAAC;IACf,OAAO,EAAE,IAAI,uBAAuB,CAAC,CAAC,WAAW,CAAC,CAAC;IACnD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE;QAC9B,GAAG,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;QAChC,GAAG,CAAC,GAAG,EAAE,CAAA;QACT,MAAM,CAAC,KAAK,EAAE,CAAA;IACf,CAAC;CACD,CAAC,CAAA;AAEF,cAAc;AACd,MAAM,CAAC,QAAQ,CAAC;IACf,OAAO,EAAE,IAAI,cAAc,CAAC,IAAI,CAAC;IACjC,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE;QAC9B,GAAG,CAAC,UAAU,GAAG,GAAG,CAAA;QACpB,GAAG,CAAC,GAAG,EAAE,CAAA;IACV,CAAC;CACD,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts index d506c93..a2cf6bb 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -1,5 +1,5 @@ -export * from './matchers'; -export * from './middlewares'; -export { type Handler, type Route, type MatchedHandler, Router, } from './Router'; -export { type ServerRequest, toServerRequest, } from './node/ServerRequest'; -export { NodeHttpRouter, type NodeHttpRouterParams, } from './node/NodeHttpRouter'; +export * from './matchers/index.js'; +export * from './middlewares/index.js'; +export { type Handler, type Route, type MatchedHandler, Router, } from './Router.js'; +export { type ServerRequest, toServerRequest, } from './node/ServerRequest.js'; +export { NodeHttpRouter, type NodeHttpRouterParams, } from './node/NodeHttpRouter.js'; diff --git a/dist/index.js b/dist/index.js index 366bae9..69e82c1 100644 --- a/dist/index.js +++ b/dist/index.js @@ -1,6 +1,6 @@ -export * from './matchers'; -export * from './middlewares'; -export { Router, } from './Router'; -export { toServerRequest, } from './node/ServerRequest'; -export { NodeHttpRouter, } from './node/NodeHttpRouter'; +export * from './matchers/index.js'; +export * from './middlewares/index.js'; +export { Router, } from './Router.js'; +export { toServerRequest, } from './node/ServerRequest.js'; +export { NodeHttpRouter, } from './node/NodeHttpRouter.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map index 6782a3a..f838ac7 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,OAAO,EAIN,MAAM,GACN,MAAM,UAAU,CAAA;AACjB,OAAO,EAEN,eAAe,GACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACN,cAAc,GAEd,MAAM,uBAAuB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,wBAAwB,CAAA;AACtC,OAAO,EAIN,MAAM,GACN,MAAM,aAAa,CAAA;AACpB,OAAO,EAEN,eAAe,GACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACN,cAAc,GAEd,MAAM,0BAA0B,CAAA"} \ No newline at end of file diff --git a/dist/matchers/AndMatcher.d.ts b/dist/matchers/AndMatcher.d.ts index 3b62f36..8fb0491 100644 --- a/dist/matchers/AndMatcher.d.ts +++ b/dist/matchers/AndMatcher.d.ts @@ -1,5 +1,5 @@ -import type { Matcher } from './Matcher'; -import { type MatchResult, type MatchResultAny, type Matched } from './MatchResult'; +import type { Matcher } from './Matcher.js'; +import { type MatchResult, type MatchResultAny, type Matched } from './MatchResult.js'; export type AndMatcherResult = MatchResult<{ and: [ MR1 extends MatchResultAny ? Matched : Partial, diff --git a/dist/matchers/AndMatcher.js b/dist/matchers/AndMatcher.js index 48e7659..e96eab6 100644 --- a/dist/matchers/AndMatcher.js +++ b/dist/matchers/AndMatcher.js @@ -1,4 +1,4 @@ -import { isMatched, } from './MatchResult'; +import { isMatched, } from './MatchResult.js'; /** * Match if every matcher matches */ diff --git a/dist/matchers/AndMatcher.js.map b/dist/matchers/AndMatcher.js.map index 54ea31a..52ddf7d 100644 --- a/dist/matchers/AndMatcher.js.map +++ b/dist/matchers/AndMatcher.js.map @@ -1 +1 @@ -{"version":3,"file":"AndMatcher.js","sourceRoot":"","sources":["../../src/matchers/AndMatcher.ts"],"names":[],"mappings":"AAGA,OAAO,EAIN,SAAS,GACT,MAAM,eAAe,CAAA;AAkBtB;;GAEG;AACH,MAAM,OAAO,UAAU;IAmBtB,YAA6B,QAM5B;QAN4B,aAAQ,GAAR,QAAQ,CAMpC;QACA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED,KAAK,CAAC,MAA8B;QAQnC,MAAM,OAAO,GAAa,EAAE,CAAA;QAC5B,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,IAAI,MAAc,CAAA;YAClB,IAAI,OAAO,EAAE,CAAC;gBACb,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;gBAC9B,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE,CAAC;oBACjC,OAAO;wBACN,OAAO,EAAE,KAAK;qBACd,CAAA;gBACF,CAAC;YACF,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrB,CAAC;QAED,OAAO;YACN,OAAO,EAAE,IAAI;YACb,MAAM,EAAE;gBACP,mBAAmB;gBACnB,GAAG,EAAE,OAAO;aACZ;SACD,CAAA;IACF,CAAC;CACD;AAED,MAAM,UAAU,GAAG,CASJ,QAMd;IACA,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;AAChC,CAAC"} \ No newline at end of file +{"version":3,"file":"AndMatcher.js","sourceRoot":"","sources":["../../src/matchers/AndMatcher.ts"],"names":[],"mappings":"AAGA,OAAO,EAIN,SAAS,GACT,MAAM,kBAAkB,CAAA;AAkBzB;;GAEG;AACH,MAAM,OAAO,UAAU;IAmBtB,YAA6B,QAM5B;QAN4B,aAAQ,GAAR,QAAQ,CAMpC;QACA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED,KAAK,CAAC,MAA8B;QAQnC,MAAM,OAAO,GAAa,EAAE,CAAA;QAC5B,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACrC,IAAI,MAAc,CAAA;YAClB,IAAI,OAAO,EAAE,CAAC;gBACb,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;gBAC9B,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE,CAAC;oBACjC,OAAO;wBACN,OAAO,EAAE,KAAK;qBACd,CAAA;gBACF,CAAC;YACF,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACrB,CAAC;QAED,OAAO;YACN,OAAO,EAAE,IAAI;YACb,MAAM,EAAE;gBACP,mBAAmB;gBACnB,GAAG,EAAE,OAAO;aACZ;SACD,CAAA;IACF,CAAC;CACD;AAED,MAAM,UAAU,GAAG,CASJ,QAMd;IACA,OAAO,IAAI,UAAU,CAAC,QAAQ,CAAC,CAAA;AAChC,CAAC"} \ No newline at end of file diff --git a/dist/matchers/BooleanMatcher.d.ts b/dist/matchers/BooleanMatcher.d.ts index c119916..8052ff1 100644 --- a/dist/matchers/BooleanMatcher.d.ts +++ b/dist/matchers/BooleanMatcher.d.ts @@ -1,5 +1,5 @@ -import type { MatchResult } from './MatchResult'; -import type { Matcher } from './Matcher'; +import type { MatchResult } from './MatchResult.js'; +import type { Matcher } from './Matcher.js'; export declare class BooleanMatcher implements Matcher, void> { private value; constructor(value: T); diff --git a/dist/matchers/EndpointMatcher.d.ts b/dist/matchers/EndpointMatcher.d.ts index dbf51de..acc1fc5 100644 --- a/dist/matchers/EndpointMatcher.d.ts +++ b/dist/matchers/EndpointMatcher.d.ts @@ -1,7 +1,7 @@ -import type { Matcher } from './Matcher'; -import type { MatchResult } from './MatchResult'; -import { type Method } from './MethodMatcher'; -import { type RegExpExecGroupArray } from './RegExpUrlMatcher'; +import type { Matcher } from './Matcher.js'; +import type { MatchResult } from './MatchResult.js'; +import { type Method } from './MethodMatcher.js'; +import { type RegExpExecGroupArray } from './RegExpUrlMatcher.js'; export interface EndpointMatcherInput { req: { url: string; diff --git a/dist/matchers/EndpointMatcher.js b/dist/matchers/EndpointMatcher.js index 68ed834..d344558 100644 --- a/dist/matchers/EndpointMatcher.js +++ b/dist/matchers/EndpointMatcher.js @@ -1,6 +1,6 @@ -import { MethodMatcher, } from './MethodMatcher'; -import { and, } from './AndMatcher'; -import { RegExpUrlMatcher, } from './RegExpUrlMatcher'; +import { MethodMatcher, } from './MethodMatcher.js'; +import { and, } from './AndMatcher.js'; +import { RegExpUrlMatcher, } from './RegExpUrlMatcher.js'; /** * higher order matcher which is combine matching of method * with regular expression diff --git a/dist/matchers/EndpointMatcher.js.map b/dist/matchers/EndpointMatcher.js.map index 67caa7e..3661e3c 100644 --- a/dist/matchers/EndpointMatcher.js.map +++ b/dist/matchers/EndpointMatcher.js.map @@ -1 +1 @@ -{"version":3,"file":"EndpointMatcher.js","sourceRoot":"","sources":["../../src/matchers/EndpointMatcher.ts"],"names":[],"mappings":"AAMA,OAAO,EAGN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAEN,GAAG,GACH,MAAM,cAAc,CAAA;AACrB,OAAO,EAGN,gBAAgB,GAChB,MAAM,oBAAoB,CAAA;AAoB3B;;;GAGG;AACH,MAAM,OAAO,eAAe;IAW3B,YAAY,OAA0B,EAAE,GAAW;QAClD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;YAClB,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAC/D,IAAI,gBAAgB,CAAO,CAAC,GAAG,CAAC,CAAC;SACjC,CAAC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,MAA4B;QACjC,mBAAmB;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAEzC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA;YACnD,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACP,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM;oBAClC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK;iBAC7B;aACD,CAAA;QACF,CAAC;QAED,OAAO;YACN,OAAO,EAAE,KAAK;SACd,CAAA;IACF,CAAC;CACD;AAED,MAAM,UAAU,QAAQ,CAGtB,OAA0B,EAAE,GAAW;IACxC,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AACzC,CAAC"} \ No newline at end of file +{"version":3,"file":"EndpointMatcher.js","sourceRoot":"","sources":["../../src/matchers/EndpointMatcher.ts"],"names":[],"mappings":"AAMA,OAAO,EAGN,aAAa,GACb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAEN,GAAG,GACH,MAAM,iBAAiB,CAAA;AACxB,OAAO,EAGN,gBAAgB,GAChB,MAAM,uBAAuB,CAAA;AAoB9B;;;GAGG;AACH,MAAM,OAAO,eAAe;IAW3B,YAAY,OAA0B,EAAE,GAAW;QAClD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAClC,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;YAClB,IAAI,aAAa,CAAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;YAC/D,IAAI,gBAAgB,CAAO,CAAC,GAAG,CAAC,CAAC;SACjC,CAAC,CAAA;IACH,CAAC;IAED,KAAK,CAAC,MAA4B;QACjC,mBAAmB;QACnB,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;QAEzC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,MAAM,CAAC,YAAY,EAAE,SAAS,CAAC,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA;YACnD,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACP,MAAM,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM;oBAClC,KAAK,EAAE,SAAS,CAAC,MAAM,CAAC,KAAK;iBAC7B;aACD,CAAA;QACF,CAAC;QAED,OAAO;YACN,OAAO,EAAE,KAAK;SACd,CAAA;IACF,CAAC;CACD;AAED,MAAM,UAAU,QAAQ,CAGtB,OAA0B,EAAE,GAAW;IACxC,OAAO,IAAI,eAAe,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AACzC,CAAC"} \ No newline at end of file diff --git a/dist/matchers/ExactQueryMatcher.d.ts b/dist/matchers/ExactQueryMatcher.d.ts index c010cc2..cbdfe7d 100644 --- a/dist/matchers/ExactQueryMatcher.d.ts +++ b/dist/matchers/ExactQueryMatcher.d.ts @@ -1,5 +1,5 @@ -import type { Matcher } from './Matcher'; -import type { MatchResult } from './MatchResult'; +import type { Matcher } from './Matcher.js'; +import type { MatchResult } from './MatchResult.js'; export interface ExactQueryMatcherInput { req: { url: string; diff --git a/dist/matchers/ExactUrlPathnameMatcher.d.ts b/dist/matchers/ExactUrlPathnameMatcher.d.ts index 2b5179a..5563410 100644 --- a/dist/matchers/ExactUrlPathnameMatcher.d.ts +++ b/dist/matchers/ExactUrlPathnameMatcher.d.ts @@ -1,5 +1,5 @@ -import type { Matcher } from './Matcher'; -import type { MatchResult } from './MatchResult'; +import type { Matcher } from './Matcher.js'; +import type { MatchResult } from './MatchResult.js'; export interface ExactUrlPathnameMatcherInput { req: { url: string; diff --git a/dist/matchers/Matcher.d.ts b/dist/matchers/Matcher.d.ts index f29f15f..32ff31d 100644 --- a/dist/matchers/Matcher.d.ts +++ b/dist/matchers/Matcher.d.ts @@ -1,4 +1,4 @@ -import type { MatchResultAny } from './MatchResult'; +import type { MatchResultAny } from './MatchResult.js'; export type ExtractMatchResult = M extends Matcher ? MR : never; export interface Matcher { match(params: P): T; diff --git a/dist/matchers/MethodMatcher.d.ts b/dist/matchers/MethodMatcher.d.ts index 31cac7a..a5e7e19 100644 --- a/dist/matchers/MethodMatcher.d.ts +++ b/dist/matchers/MethodMatcher.d.ts @@ -1,5 +1,5 @@ -import type { Matcher } from './Matcher'; -import type { MatchResult } from './MatchResult'; +import type { Matcher } from './Matcher.js'; +import type { MatchResult } from './MatchResult.js'; declare const validMethods: readonly ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]; export interface MethodMatcherInput { req: { diff --git a/dist/matchers/OrMatcher.d.ts b/dist/matchers/OrMatcher.d.ts index e10efff..fa25a58 100644 --- a/dist/matchers/OrMatcher.d.ts +++ b/dist/matchers/OrMatcher.d.ts @@ -1,5 +1,5 @@ -import type { Matcher } from './Matcher'; -import { type MatchResult, type MatchResultAny, type Matched } from './MatchResult'; +import type { Matcher } from './Matcher.js'; +import { type MatchResult, type MatchResultAny, type Matched } from './MatchResult.js'; export type OrMatcherResult = MatchResult<{ or: [ MR1 extends MatchResultAny ? Matched : Partial, diff --git a/dist/matchers/OrMatcher.js b/dist/matchers/OrMatcher.js index 9dfadfe..cdc4a1b 100644 --- a/dist/matchers/OrMatcher.js +++ b/dist/matchers/OrMatcher.js @@ -1,4 +1,4 @@ -import { isMatched, } from './MatchResult'; +import { isMatched, } from './MatchResult.js'; /** * Match if at least one matcher matches. * For completeness both matcher are executed. diff --git a/dist/matchers/OrMatcher.js.map b/dist/matchers/OrMatcher.js.map index 0fdcfd7..c2bc6e2 100644 --- a/dist/matchers/OrMatcher.js.map +++ b/dist/matchers/OrMatcher.js.map @@ -1 +1 @@ -{"version":3,"file":"OrMatcher.js","sourceRoot":"","sources":["../../src/matchers/OrMatcher.ts"],"names":[],"mappings":"AAGA,OAAO,EAIN,SAAS,GACT,MAAM,eAAe,CAAA;AAkBtB;;;GAGG;AACH,MAAM,OAAO,SAAS;IAmBrB,YAA6B,QAM5B;QAN4B,aAAQ,GAAR,QAAQ,CAMpC;QACA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED,KAAK,CAAC,MAA8B;QAOnC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;QAEpE,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YACzD,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACP,mBAAmB;oBACnB,EAAE,EAAE,OAAO;iBACX;aACD,CAAA;QACF,CAAC;QACD,OAAO;YACN,OAAO,EAAE,KAAK;SACd,CAAA;IACF,CAAC;CACD;AAED,MAAM,UAAU,EAAE,CASH,QAMd;IACA,OAAO,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAA;AAC/B,CAAC"} \ No newline at end of file +{"version":3,"file":"OrMatcher.js","sourceRoot":"","sources":["../../src/matchers/OrMatcher.ts"],"names":[],"mappings":"AAGA,OAAO,EAIN,SAAS,GACT,MAAM,kBAAkB,CAAA;AAkBzB;;;GAGG;AACH,MAAM,OAAO,SAAS;IAmBrB,YAA6B,QAM5B;QAN4B,aAAQ,GAAR,QAAQ,CAMpC;QACA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED,KAAK,CAAC,MAA8B;QAOnC,MAAM,OAAO,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;QAEpE,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;YACzD,OAAO;gBACN,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE;oBACP,mBAAmB;oBACnB,EAAE,EAAE,OAAO;iBACX;aACD,CAAA;QACF,CAAC;QACD,OAAO;YACN,OAAO,EAAE,KAAK;SACd,CAAA;IACF,CAAC;CACD;AAED,MAAM,UAAU,EAAE,CASH,QAMd;IACA,OAAO,IAAI,SAAS,CAAC,QAAQ,CAAC,CAAA;AAC/B,CAAC"} \ No newline at end of file diff --git a/dist/matchers/RegExpUrlMatcher.d.ts b/dist/matchers/RegExpUrlMatcher.d.ts index 53a6c35..e23dd43 100644 --- a/dist/matchers/RegExpUrlMatcher.d.ts +++ b/dist/matchers/RegExpUrlMatcher.d.ts @@ -1,5 +1,5 @@ -import type { Matcher } from './Matcher'; -import type { MatchResult } from './MatchResult'; +import type { Matcher } from './Matcher.js'; +import type { MatchResult } from './MatchResult.js'; export interface RegExpUrlMatcherInput { req: { url: string; diff --git a/dist/matchers/__tests__/AndMatcher.test.js b/dist/matchers/__tests__/AndMatcher.test.js index e26ac1a..e5a6396 100644 --- a/dist/matchers/__tests__/AndMatcher.test.js +++ b/dist/matchers/__tests__/AndMatcher.test.js @@ -1,5 +1,5 @@ import { createRequest, } from 'node-mocks-http'; -import { BooleanMatcher, ExactUrlPathnameMatcher, MethodMatcher, and, } from '..'; +import { BooleanMatcher, ExactUrlPathnameMatcher, MethodMatcher, and, } from '../index.js'; it('none match', () => { const result = and([ new MethodMatcher(['POST']), diff --git a/dist/matchers/__tests__/AndMatcher.test.js.map b/dist/matchers/__tests__/AndMatcher.test.js.map index 9feb5a5..07383af 100644 --- a/dist/matchers/__tests__/AndMatcher.test.js.map +++ b/dist/matchers/__tests__/AndMatcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"AndMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/AndMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,GAAG,GACH,MAAM,IAAI,CAAA;AAKX,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI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C,CAAC,OAAO,CAAC,CAAC;QACtC,IAAI,cAAc,CAAC,IAAI,CAAC;KACxB,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IAEjB,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,GAAG,EAAE;gBACJ;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE;wBACP,MAAM,EAAE,KAAK;qBACb;iBACD;gBACD;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE;wBACP,QAAQ,EAAE,OAAO;qBACjB;iBACD;gBACD;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE,IAAI;iBACZ;aACD;SACD;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"AndMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/AndMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,cAAc,EACd,uBAAuB,EACvB,aAAa,EACb,GAAG,GACH,MAAM,aAAa,CAAA;AAKpB,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;IACrB,MAAM,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;QAC3B,IAAI,uBAAuB,CAAC,CAAC,OAAO,CAAC,CAAC;KACtC,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,EAAiB,EAAE,CAAC,CAAA;IAEjD,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,KAAK;KACd,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,yBAAyB,EAAE,GAAG,EAAE;IAClC,MAAM,MAAM,GAAG,GAAG,CAAC;QAClB,IAAI,aAAa,CAAC,CAAC,KAAK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BACD;gBACD;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE,IAAI;iBACZ;aACD;SACD;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/matchers/__tests__/BooleanMatcher.test.js b/dist/matchers/__tests__/BooleanMatcher.test.js index 27f4fa6..8bf4211 100644 --- a/dist/matchers/__tests__/BooleanMatcher.test.js +++ b/dist/matchers/__tests__/BooleanMatcher.test.js @@ -1,4 +1,4 @@ -import { bool, } from '..'; +import { bool, } from '../index.js'; it('match', () => { const result = bool(true) .match(); diff --git a/dist/matchers/__tests__/BooleanMatcher.test.js.map b/dist/matchers/__tests__/BooleanMatcher.test.js.map index 572e286..3c9fac2 100644 --- a/dist/matchers/__tests__/BooleanMatcher.test.js.map +++ b/dist/matchers/__tests__/BooleanMatcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"BooleanMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/BooleanMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,IAAI,GACJ,MAAM,IAAI,CAAA;AAEX,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;IAChB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;SACvB,KAAK,EAAE,CAAA;IACT,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;KACZ,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IACpB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;SACxB,KAAK,EAAE,CAAA;IACT,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,KAAK;KACd,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"BooleanMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/BooleanMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,IAAI,GACJ,MAAM,aAAa,CAAA;AAEpB,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;IAChB,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC;SACvB,KAAK,EAAE,CAAA;IACT,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE,IAAI;KACZ,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IACpB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC;SACxB,KAAK,EAAE,CAAA;IACT,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,KAAK;KACd,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/matchers/__tests__/EndpointMatcher.test.js b/dist/matchers/__tests__/EndpointMatcher.test.js index 52a4bd1..cd083b6 100644 --- a/dist/matchers/__tests__/EndpointMatcher.test.js +++ b/dist/matchers/__tests__/EndpointMatcher.test.js @@ -1,5 +1,5 @@ import { createRequest, } from 'node-mocks-http'; -import { endpoint, } from '..'; +import { endpoint, } from '../index.js'; it('not match empty', () => { const result = endpoint('GET', /\/test/) .match({ req: createRequest() }); diff --git a/dist/matchers/__tests__/EndpointMatcher.test.js.map b/dist/matchers/__tests__/EndpointMatcher.test.js.map index 55c9876..e215a52 100644 --- a/dist/matchers/__tests__/EndpointMatcher.test.js.map +++ b/dist/matchers/__tests__/EndpointMatcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"EndpointMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/EndpointMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,QAAQ,GACR,MAAM,IAAI,CAAA;AAKX,EAAE,CAA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ACjC,MAAM,EAAE,SAAS;YACjB,GAAG,EAAE,OAAO;SACZ,CAAC;KACF,CAAC,CAAC,CAAC,aAAa,CAAC;QACjB,OAAO,EAAE,KAAK;KACd,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;IACrB,MAAM,OAAO,GAAG,QAAQ,CAAqB,KAAK,EAAE,iCAAiC,CAAC,CAAA;IACtF,sEAAsE;IACtE,MAAM,CAAC,GAAG,EAAE;QACX,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC3B,GAAG,EAAE,aAAa,CAAgB;gBACjC,GAAG,EAAE,aAAa;aAClB,CAAC;SACF,CAAC,CAAA;QACF,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC;YAC3B,OAAO,EAAE,IAAI;YACb,MAAM,EAAE;gBACP,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE;oBACN,aAAa;oBACb,GAAG;iBACH;aACD;SACD,CAAC,CAAA;IACH,CAAC,CAAC,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAC5C,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"EndpointMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/EndpointMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,QAAQ,GACR,MAAM,aAAa,CAAA;AAKpB,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC1B,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;SACtC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,EAAiB,EAAE,CAAC,CAAA;IAChD,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,KAAK;KACd,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,aAAa,EAAE,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GAAG,EAAE;QACX,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;YAC3B,GAAG,EAAE,aAAa,CAAgB;gBACjC,GAAG,EAAE,aAAa;aAClB,CAAC;SACF,CAAC,CAAA;QACF,MAAM,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC;YAC3B,OAAO,EAAE,IAAI;YACb,MAAM,EAAE;gBACP,MAAM,EAAE,KAAK;gBACb,KAAK,EAAE;oBACN,aAAa;oBACb,GAAG;iBACH;aACD;SACD,CAAC,CAAA;IACH,CAAC,CAAC,CAAC,OAAO,CAAC,+BAA+B,CAAC,CAAA;AAC5C,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/matchers/__tests__/ExactQueryMatcher.test.js b/dist/matchers/__tests__/ExactQueryMatcher.test.js index 24daa37..390fb56 100644 --- a/dist/matchers/__tests__/ExactQueryMatcher.test.js +++ b/dist/matchers/__tests__/ExactQueryMatcher.test.js @@ -1,5 +1,5 @@ import { createRequest, } from 'node-mocks-http'; -import { exactQuery, } from '..'; +import { exactQuery, } from '../index.js'; const matcher = exactQuery({ mustPresent: true, mustAbsent: false, diff --git a/dist/matchers/__tests__/ExactQueryMatcher.test.js.map b/dist/matchers/__tests__/ExactQueryMatcher.test.js.map index 3490690..fe6cd8d 100644 --- a/dist/matchers/__tests__/ExactQueryMatcher.test.js.map +++ b/dist/matchers/__tests__/ExactQueryMatcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ExactQueryMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/ExactQueryMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,UAAU,GACV,MAAM,IAAI,CAAA;AAKX,MAAM,OAAO,GAAG,UAAU,CAAC;IAC1B,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,CAAC,aAAa,EAAE,aA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AC,SAAS,CAAA;IAC/E,CAAC;AACF,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"ExactQueryMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/ExactQueryMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,UAAU,GACV,MAAM,aAAa,CAAA;AAKpB,MAAM,OAAO,GAAG,UAAU,CAAC;IAC1B,WAAW,EAAE,IAAI;IACjB,UAAU,EAAE,KAAK;IACjB,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,CAAC,aAAa,EAAE,aAAa,CAAU;CAClD,CAAC,CAAA;AAEF,EAAE,CAAC,mDAAmD,EAAE,GAAG,EAAE;IAC5D,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,EAAiB,EAAE,CAAC,CAAA;IACrE,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,KAAK;KACd,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;IAC7C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,6BAA6B;SAClC,CAAC;KACF,CAAC,CAAA;IACF,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,KAAK;KACd,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,kCAAkC,EAAE,GAAG,EAAE;IAC3C,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5B,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,uBAAuB;SAC5B,CAAC;KACF,CAAC,CAAA;IACF,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,K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,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,4DAA4D;SACjE,CAAC;KACF,CAAC,CAAA;IACF,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,KAAK,EAAE;gBACN,SAAS,EAAE,aAAa;gBACxB,WAAW,EAAE,KAAK;gBAClB,UAAU,EAAE,KAAK;aACjB;SACD;KACD,CAAC,CAAA;IACF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,6DAA6D;QAC7D,MAAM,SAAS,GAAkC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,SAAS,CAAA;IAC/E,CAAC;AACF,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/matchers/__tests__/ExactUrlPathnameMatcher.test.js b/dist/matchers/__tests__/ExactUrlPathnameMatcher.test.js index f610b38..0ac19a3 100644 --- a/dist/matchers/__tests__/ExactUrlPathnameMatcher.test.js +++ b/dist/matchers/__tests__/ExactUrlPathnameMatcher.test.js @@ -1,5 +1,5 @@ import { createRequest, } from 'node-mocks-http'; -import { exactUrlPathname, } from '..'; +import { exactUrlPathname, } from '../index.js'; it('not match empty', () => { const result = exactUrlPathname(['/test']) .match({ req: createRequest() }); diff --git a/dist/matchers/__tests__/ExactUrlPathnameMatcher.test.js.map b/dist/matchers/__tests__/ExactUrlPathnameMatcher.test.js.map index 5766248..301104b 100644 --- a/dist/matchers/__tests__/ExactUrlPathnameMatcher.test.js.map +++ b/dist/matchers/__tests__/ExactUrlPathnameMatcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"ExactUrlPathnameMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/ExactUrlPathnameMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,gBAAgB,GAChB,MAAM,IAAI,CAAA;AAKX,EAAE,CAAC,iBAAiB,EAAE,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CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;IACtB,MAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAChD,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,OAAO;SACZ,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,QAAQ,EAAE,OAAO;SACjB;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;IACvB,MAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAChD,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,MAAM;SACX,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,QAAQ,EAAE,MAAM;SAChB;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"ExactUrlPathnameMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/ExactUrlPathnameMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,gBAAgB,GAChB,MAAM,aAAa,CAAA;AAKpB,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC1B,MAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,OAAO,CAAC,CAAC;SACxC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,EAAiB,EAAE,CAAC,CAAA;IAChD,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OA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AAG,EAAE,OAAO;SACZ,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,QAAQ,EAAE,OAAO;SACjB;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;IACvB,MAAM,MAAM,GAAG,gBAAgB,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;SAChD,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,MAAM;SACX,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,QAAQ,EAAE,MAAM;SAChB;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/matchers/__tests__/MethodMatcher.test.js b/dist/matchers/__tests__/MethodMatcher.test.js index efbb630..50ddab4 100644 --- a/dist/matchers/__tests__/MethodMatcher.test.js +++ b/dist/matchers/__tests__/MethodMatcher.test.js @@ -1,5 +1,5 @@ import { createRequest, } from 'node-mocks-http'; -import { method, } from '../MethodMatcher'; +import { method, } from '../MethodMatcher.js'; it('not match', () => { const result = method(['POST']) .match({ req: createRequest() }); diff --git a/dist/matchers/__tests__/MethodMatcher.test.js.map b/dist/matchers/__tests__/MethodMatcher.test.js.map index aab6bfa..dbfbbc2 100644 --- a/dist/matchers/__tests__/MethodMatcher.test.js.map +++ b/dist/matchers/__tests__/MethodMatcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"MethodMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/MethodMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,MAAM,GACN,MAAM,kBAAkB,CAAA;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ACH,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,MAAM,EAAE,KAAK;SACb;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"MethodMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/MethodMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,MAAM,GACN,MAAM,qBAAqB,CAAA;AAK5B,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IACpB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;SAC7B,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,EAAiB,EAAE,CAAC,CAAA;IAChD,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,KAAK;KACd,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IACpB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC;SAC5B,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,OAAO;SACZ,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,MAAM,EAAE,KAAK;SACb;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;IACtB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SACpC,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,MAAM,EAAE,MAAM;SACd,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,MAAM,EAAE,MAAM;SACd;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;IACvB,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;SACpC,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,MAAM,EAAE,KAAK;SACb,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,MAAM,EAAE,KAAK;SACb;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/matchers/__tests__/OrMatcher.test.js b/dist/matchers/__tests__/OrMatcher.test.js index 8b43fe6..ff7c03a 100644 --- a/dist/matchers/__tests__/OrMatcher.test.js +++ b/dist/matchers/__tests__/OrMatcher.test.js @@ -1,5 +1,5 @@ import { createRequest, } from 'node-mocks-http'; -import { ExactUrlPathnameMatcher, MethodMatcher, or, } from '..'; +import { ExactUrlPathnameMatcher, MethodMatcher, or, } from '../index.js'; it('none match', () => { const result = or([ new MethodMatcher(['DELETE']), diff --git a/dist/matchers/__tests__/OrMatcher.test.js.map b/dist/matchers/__tests__/OrMatcher.test.js.map index e699fe7..47c68b6 100644 --- a/dist/matchers/__tests__/OrMatcher.test.js.map +++ b/dist/matchers/__tests__/OrMatcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"OrMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/OrMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,uBAAuB,EACvB,aAAa,EACb,EAAE,GACF,MAAM,IAAI,CAAA;AAKX,EAAE,CAAC,YA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AAG,EAAE,CAAC,CAAA;IACjB,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,EAAE,EAAE;gBACH;oBACC,OAAO,EAAE,KAAK;iBACd;gBACD;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE;wBACP,MAAM,EAAE,MAAM;qBACd;iBACD;gBACD,SAAS;aACT;SACD;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;IACrB,MAAM,GAAG,GAAG,aAAa,CAAgB;QACxC,GAAG,EAAE,OAAO;KACZ,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,uBAAuB,CAAC,CAAC,OAAO,CAAC,CAAC;KACtC,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IACjB,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,EAAE,EAAE;gBACH;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE;wBACP,MAAM,EAAE,KAAK;qBACb;iBACD;gBACD;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE;wBACP,QAAQ,EAAE,OAAO;qBACjB;iBACD;aACD;SACD;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"OrMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/OrMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,uBAAuB,EACvB,aAAa,EACb,EAAE,GACF,MAAM,aAAa,CAAA;AAKpB,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;IACrB,MAAM,M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CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,EAAE,EAAE;gBACH;oBACC,OAAO,EAAE,KAAK;iBACd;gBACD;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE;wBACP,MAAM,EAAE,MAAM;qBACd;iBACD;gBACD,SAAS;aACT;SACD;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,YAAY,EAAE,GAAG,EAAE;IACrB,MAAM,GAAG,GAAG,aAAa,CAAgB;QACxC,GAAG,EAAE,OAAO;KACZ,CAAC,CAAA;IAEF,MAAM,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC;QAC1B,IAAI,uBAAuB,CAAC,CAAC,OAAO,CAAC,CAAC;KACtC,CAAC,CAAC,KAAK,CAAC,EAAE,GAAG,EAAE,CAAC,CAAA;IACjB,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,IAAI;QACb,MAAM,EAAE;YACP,EAAE,EAAE;gBACH;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE;wBACP,MAAM,EAAE,KAAK;qBACb;iBACD;gBACD;oBACC,OAAO,EAAE,IAAI;oBACb,MAAM,EAAE;wBACP,QAAQ,EAAE,OAAO;qBACjB;iBACD;aACD;SACD;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/matchers/__tests__/RegExpUrlMatcher.test.js b/dist/matchers/__tests__/RegExpUrlMatcher.test.js index 8c5090d..1ac1d9c 100644 --- a/dist/matchers/__tests__/RegExpUrlMatcher.test.js +++ b/dist/matchers/__tests__/RegExpUrlMatcher.test.js @@ -1,5 +1,5 @@ import { createRequest, } from 'node-mocks-http'; -import { regExpUrl, } from '..'; +import { regExpUrl, } from '../index.js'; it('not match', () => { const result = regExpUrl([/^\/test$/]) .match({ req: createRequest() }); diff --git a/dist/matchers/__tests__/RegExpUrlMatcher.test.js.map b/dist/matchers/__tests__/RegExpUrlMatcher.test.js.map index 06cc1fb..667d1e3 100644 --- a/dist/matchers/__tests__/RegExpUrlMatcher.test.js.map +++ b/dist/matchers/__tests__/RegExpUrlMatcher.test.js.map @@ -1 +1 @@ -{"version":3,"file":"RegExpUrlMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/RegExpUrlMatcher.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,GACb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,SAAS,GACT,MAAM,IAAI,CAAA;AAKX,EAAE,CAAC,WAAW,EAAE,GAAG,EAAE;IACpB,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;SACpC,KAAK,CAAC,EAAE,GAAG,EAAE,aAAa,EAAiB,EAAE,CAAC,CAAA;IAChD,MAAM,CAAC,MAAM,CAAC,CAAC,aAAa,CAAC;QAC5B,OAAO,EAAE,KAAK;KACd,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;IAChB,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;SACpC,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,OAAO;SACZ,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;AACF,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,aAAa,EAAE,GAAG,EAAE;IACtB,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,UAAU,E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C,KAAK,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;QACpD,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;IACvD,CAAC;AACF,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;IACvB,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;SAChC,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,EAAE;SACP,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC5C,CAAC;AACF,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACrC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;SACpC,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,yBAAyB;SAC9B,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;AACF,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"RegExpUrlMatcher.test.js","sourceRoot":"","sources":["../../../src/matchers/__tests__/RegExpUrlMatcher.test.ts"],"names":[],"m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AC;SAChC,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,EAAE;SACP,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAC5C,CAAC;AACF,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,4BAA4B,EAAE,GAAG,EAAE;IACrC,MAAM,MAAM,GAAG,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;SACpC,KAAK,CAAC;QACN,GAAG,EAAE,aAAa,CAAgB;YACjC,GAAG,EAAE,yBAAyB;SAC9B,CAAC;KACF,CAAC,CAAA;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;AACF,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/matchers/index.d.ts b/dist/matchers/index.d.ts index 410ebdb..2937003 100644 --- a/dist/matchers/index.d.ts +++ b/dist/matchers/index.d.ts @@ -1,10 +1,10 @@ -export { and, AndMatcher, type AndMatcherResult, } from './AndMatcher'; -export { endpoint, EndpointMatcher, type EndpointMatcherInput, } from './EndpointMatcher'; -export { exactQuery, ExactQueryMatcher, } from './ExactQueryMatcher'; -export { exactUrlPathname, ExactUrlPathnameMatcher, type ExactUrlPathnameMatcherInput, type ExactUrlPathnameMatchResult, } from './ExactUrlPathnameMatcher'; -export { type ExtractMatchResult, type Matcher, } from './Matcher'; -export { isMatched, type Matched, type MatchResult, type MatchResultAny, type MatchedResult, type UnmatchedResult, } from './MatchResult'; -export { method, type Method, MethodMatcher, type MethodMatcherInput, type MethodMatchResult, } from './MethodMatcher'; -export { or, OrMatcher, type OrMatcherResult, } from './OrMatcher'; -export { regExpUrl, RegExpUrlMatcher, type RegExpUrlMatcherInput, type RegExpUrlMatchResult, } from './RegExpUrlMatcher'; -export { bool, BooleanMatcher, } from './BooleanMatcher'; +export { and, AndMatcher, type AndMatcherResult, } from './AndMatcher.js'; +export { endpoint, EndpointMatcher, type EndpointMatcherInput, } from './EndpointMatcher.js'; +export { exactQuery, ExactQueryMatcher, } from './ExactQueryMatcher.js'; +export { exactUrlPathname, ExactUrlPathnameMatcher, type ExactUrlPathnameMatcherInput, type ExactUrlPathnameMatchResult, } from './ExactUrlPathnameMatcher.js'; +export { type ExtractMatchResult, type Matcher, } from './Matcher.js'; +export { isMatched, type Matched, type MatchResult, type MatchResultAny, type MatchedResult, type UnmatchedResult, } from './MatchResult.js'; +export { method, type Method, MethodMatcher, type MethodMatcherInput, type MethodMatchResult, } from './MethodMatcher.js'; +export { or, OrMatcher, type OrMatcherResult, } from './OrMatcher.js'; +export { regExpUrl, RegExpUrlMatcher, type RegExpUrlMatcherInput, type RegExpUrlMatchResult, } from './RegExpUrlMatcher.js'; +export { bool, BooleanMatcher, } from './BooleanMatcher.js'; diff --git a/dist/matchers/index.js b/dist/matchers/index.js index e9931f2..511d15f 100644 --- a/dist/matchers/index.js +++ b/dist/matchers/index.js @@ -1,11 +1,11 @@ -export { and, AndMatcher, } from './AndMatcher'; -export { endpoint, EndpointMatcher, } from './EndpointMatcher'; -export { exactQuery, ExactQueryMatcher, } from './ExactQueryMatcher'; -export { exactUrlPathname, ExactUrlPathnameMatcher, } from './ExactUrlPathnameMatcher'; -export {} from './Matcher'; -export { isMatched, } from './MatchResult'; -export { method, MethodMatcher, } from './MethodMatcher'; -export { or, OrMatcher, } from './OrMatcher'; -export { regExpUrl, RegExpUrlMatcher, } from './RegExpUrlMatcher'; -export { bool, BooleanMatcher, } from './BooleanMatcher'; +export { and, AndMatcher, } from './AndMatcher.js'; +export { endpoint, EndpointMatcher, } from './EndpointMatcher.js'; +export { exactQuery, ExactQueryMatcher, } from './ExactQueryMatcher.js'; +export { exactUrlPathname, ExactUrlPathnameMatcher, } from './ExactUrlPathnameMatcher.js'; +export {} from './Matcher.js'; +export { isMatched, } from './MatchResult.js'; +export { method, MethodMatcher, } from './MethodMatcher.js'; +export { or, OrMatcher, } from './OrMatcher.js'; +export { regExpUrl, RegExpUrlMatcher, } from './RegExpUrlMatcher.js'; +export { bool, BooleanMatcher, } from './BooleanMatcher.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/matchers/index.js.map b/dist/matchers/index.js.map index f546863..daaa7ca 100644 --- a/dist/matchers/index.js.map +++ b/dist/matchers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/matchers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,GAAG,EACH,UAAU,GAEV,MAAM,cAAc,CAAA;AACrB,OAAO,EACN,QAAQ,EACR,eAAe,GAEf,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACN,UAAU,EACV,iBAAiB,GACjB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACN,gBAAgB,EAChB,uBAAuB,GAGvB,MAAM,2BAA2B,CAAA;AAClC,OAAO,EAGN,MAAM,WAAW,CAAA;AAClB,OAAO,EACN,SAAS,GAMT,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,MAAM,EAEN,aAAa,GAGb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,EAAE,EACF,SAAS,GAET,MAAM,aAAa,CAAA;AACpB,OAAO,EACN,SAAS,EACT,gBAAgB,GAGhB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACN,IAAI,EACJ,cAAc,GACd,MAAM,kBAAkB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/matchers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,GAAG,EACH,UAAU,GAEV,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,QAAQ,EACR,eAAe,GAEf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACN,UAAU,EACV,iBAAiB,GACjB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,EACN,gBAAgB,EAChB,uBAAuB,GAGvB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EAGN,MAAM,cAAc,CAAA;AACrB,OAAO,EACN,SAAS,GAMT,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACN,MAAM,EAEN,aAAa,GAGb,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACN,EAAE,EACF,SAAS,GAET,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACN,SAAS,EACT,gBAAgB,GAGhB,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACN,IAAI,EACJ,cAAc,GACd,MAAM,qBAAqB,CAAA"} \ No newline at end of file diff --git a/dist/middlewares/CorsMiddleware.d.ts b/dist/middlewares/CorsMiddleware.d.ts index 389bd2f..a146b10 100644 --- a/dist/middlewares/CorsMiddleware.d.ts +++ b/dist/middlewares/CorsMiddleware.d.ts @@ -1,5 +1,5 @@ -import type { MatchResultAny } from '../matchers/MatchResult'; -import type { Handler } from '../Router'; +import type { MatchResultAny } from '../matchers/MatchResult.js'; +import type { Handler } from '../Router.js'; export interface CorsMiddlewareInput { headers: { origin?: string; diff --git a/dist/middlewares/MiddlewareData.d.ts b/dist/middlewares/MiddlewareData.d.ts index a4f5400..f777aaa 100644 --- a/dist/middlewares/MiddlewareData.d.ts +++ b/dist/middlewares/MiddlewareData.d.ts @@ -1,3 +1,3 @@ -import type { MatchResultAny } from '../matchers/MatchResult'; -import type { Handler } from '../Router'; +import type { MatchResultAny } from '../matchers/MatchResult.js'; +import type { Handler } from '../Router.js'; export type MiddlewareData) => Handler> = Parameters[0]>[0]['data']; diff --git a/dist/middlewares/__tests__/CorsMiddleware.test.js b/dist/middlewares/__tests__/CorsMiddleware.test.js index f16a03d..e1f4a5f 100644 --- a/dist/middlewares/__tests__/CorsMiddleware.test.js +++ b/dist/middlewares/__tests__/CorsMiddleware.test.js @@ -1,6 +1,6 @@ import { createRequest, createResponse, } from 'node-mocks-http'; import { jest, } from '@jest/globals'; -import { CorsMiddleware, } from '../CorsMiddleware'; +import { CorsMiddleware, } from '../CorsMiddleware.js'; describe('simple configuration', () => { beforeEach(() => { jest.resetAllMocks(); diff --git a/dist/middlewares/__tests__/CorsMiddleware.test.js.map b/dist/middlewares/__tests__/CorsMiddleware.test.js.map index 8ff4910..8ff6e0c 100644 --- a/dist/middlewares/__tests__/CorsMiddleware.test.js.map +++ b/dist/middlewares/__tests__/CorsMiddleware.test.js.map @@ -1 +1 @@ -{"version":3,"file":"CorsMiddleware.test.js","sourceRoot":"","sources":["../../../src/middlewares/__tests__/CorsMiddleware.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EACb,cAAc,GACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,IAAI,GACJ,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,cAAc,GACd,MAAM,mBAAmB,CAAA;AAE1B,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACrC,UAAU,CAAC,GAAG,EAAE;QACf,IAAI,CAAC,aAAa,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,MAAM,YAAY,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC9B,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC3C,OAAO,EAAE,CAAC,qBAAqB,CAAC;KAChC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA;IAEjB,EAAE,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;QAC1B,MAAM,GAAG,GAAG,aAAa,CAAC;YACzB,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;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,CAAA;QAC/E,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,wBAAwB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QAC3D,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,kCAAkC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAA;IAC1E,CAAC,CAAC,CAAA;AACH,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"CorsMiddleware.test.js","sourceRoot":"","sources":["../../../src/middlewares/__tests__/CorsMiddleware.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,aAAa,EACb,cAAc,GACd,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,IAAI,GACJ,MAAM,eAAe,CAAA;AACtB,OAAO,EACN,cAAc,GACd,MAAM,sBAAsB,CAAA;AAE7B,QAAQ,CAAC,sBAAsB,EAAE,GAAG,EAAE;IACrC,UAAU,CAAC,GAAG,EAAE;QACf,IAAI,CAAC,aAAa,EAAE,CAAA;IACrB,CAAC,CAAC,CAAA;IAEF,MAAM,YAAY,GAAG,IAAI,CAAC,EAAE,EAAE,CAAA;IAC9B,MAAM,OAAO,GAAG,cAAc,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;QAC3C,OAAO,EAAE,CAAC,qBAAqB,CAAC;KAChC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAA;IAEjB,EAAE,CAAC,WAAW,EAAE,KAAK,IAAI,EAAE;QAC1B,MAAM,GAAG,GAAG,aAAa,CAAC;YACzB,MAAM,EAAE,KAAK;YACb,OAAO,EAAE;gBACR,MAAM,EAAE,qBAAqB;aAC7B;SACD,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,cAAc,EAAE,CAAA;QAC5B,MAAM,OAAO,CAAC;YACb,IAAI,EAAE;gBACL,GAAG;gBACH,GAAG;aACH;YACD,KAAK,EAAE;gBACN,OAAO,EAAE,IAAI;gBACb,MAAM,EAAE,SAAS;aACjB;SACD,CAAC,CAAA;QACF,MAAM,C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dist/middlewares/index.d.ts b/dist/middlewares/index.d.ts index 63c08c9..cd4ede5 100644 --- a/dist/middlewares/index.d.ts +++ b/dist/middlewares/index.d.ts @@ -1,2 +1,2 @@ -export { CorsMiddleware, type CorsMiddlewareCallbackResult, type CorsMiddlewareInput, } from './CorsMiddleware'; -export { type MiddlewareData, } from './MiddlewareData'; +export { CorsMiddleware, type CorsMiddlewareCallbackResult, type CorsMiddlewareInput, } from './CorsMiddleware.js'; +export { type MiddlewareData, } from './MiddlewareData.js'; diff --git a/dist/middlewares/index.js b/dist/middlewares/index.js index b0bbc41..d84906b 100644 --- a/dist/middlewares/index.js +++ b/dist/middlewares/index.js @@ -1,3 +1,3 @@ -export { CorsMiddleware, } from './CorsMiddleware'; -export {} from './MiddlewareData'; +export { CorsMiddleware, } from './CorsMiddleware.js'; +export {} from './MiddlewareData.js'; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/middlewares/index.js.map b/dist/middlewares/index.js.map index ec3c202..17f7e50 100644 --- a/dist/middlewares/index.js.map +++ b/dist/middlewares/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,cAAc,GAGd,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAEN,MAAM,kBAAkB,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/middlewares/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,cAAc,GAGd,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAEN,MAAM,qBAAqB,CAAA"} \ No newline at end of file diff --git a/dist/node/NodeHttpRouter.d.ts b/dist/node/NodeHttpRouter.d.ts index 442f2d9..0a50440 100644 --- a/dist/node/NodeHttpRouter.d.ts +++ b/dist/node/NodeHttpRouter.d.ts @@ -1,8 +1,8 @@ /// import { IncomingMessage, ServerResponse } from 'http'; -import type { MatchResult, MatchedResult } from '../matchers'; -import { type Handler, Router } from '../Router'; -import { type ServerRequest } from './ServerRequest'; +import type { MatchResult, MatchedResult } from '../matchers/index.js'; +import { type Handler, Router } from '../Router.js'; +import { type ServerRequest } from './ServerRequest.js'; interface ServerRequestResponse { req: ServerRequest; res: ServerResponse; diff --git a/dist/node/NodeHttpRouter.js b/dist/node/NodeHttpRouter.js index 46d6808..1362dcd 100644 --- a/dist/node/NodeHttpRouter.js +++ b/dist/node/NodeHttpRouter.js @@ -1,6 +1,6 @@ import { IncomingMessage, ServerResponse, } from 'http'; -import { Router, } from '../Router'; -import { toServerRequest, } from './ServerRequest'; +import { Router, } from '../Router.js'; +import { toServerRequest, } from './ServerRequest.js'; export class NodeHttpRouter extends Router { constructor(defaultHandler) { super(defaultHandler); diff --git a/dist/node/NodeHttpRouter.js.map b/dist/node/NodeHttpRouter.js.map index 511f257..09eb20b 100644 --- a/dist/node/NodeHttpRouter.js.map +++ b/dist/node/NodeHttpRouter.js.map @@ -1 +1 @@ -{"version":3,"file":"NodeHttpRouter.js","sourceRoot":"","sources":["../../src/node/NodeHttpRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,GACd,MAAM,MAAM,CAAA;AAKb,OAAO,EAEN,MAAM,GACN,MAAM,WAAW,CAAA;AAClB,OAAO,EAEN,eAAe,GACf,MAAM,iBAAiB,CAAA;AAYxB,MAAM,OAAO,cAAe,SAAQ,MAA6B;IAChE,YAAY,cAAqE;QAChF,KAAK,CAAC,cAAc,CAAC,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED,8DAA8D;IAC9D,KAAK,CAAC,GAAoB,EAAE,GAAmB;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC;YAChB,GAAG,EAAE,eAAe,CAAC,GAAG,CAAC;YACzB,GAAG;SACH,CAAC,CAAA;IACH,CAAC;CACD"} \ No newline at end of file +{"version":3,"file":"NodeHttpRouter.js","sourceRoot":"","sources":["../../src/node/NodeHttpRouter.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,GACd,MAAM,MAAM,CAAA;AAKb,OAAO,EAEN,MAAM,GACN,MAAM,cAAc,CAAA;AACrB,OAAO,EAEN,eAAe,GACf,MAAM,oBAAoB,CAAA;AAY3B,MAAM,OAAO,cAAe,SAAQ,MAA6B;IAChE,YAAY,cAAqE;QAChF,KAAK,CAAC,cAAc,CAAC,CAAA;QACrB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAED,8DAA8D;IAC9D,KAAK,CAAC,GAAoB,EAAE,GAAmB;QAC9C,OAAO,IAAI,CAAC,IAAI,CAAC;YAChB,GAAG,EAAE,eAAe,CAAC,GAAG,CAAC;YACzB,GAAG;SACH,CAAC,CAAA;IACH,CAAC;CACD"} \ No newline at end of file diff --git a/dist/node/__tests__/NodeHttpRouter.test.js b/dist/node/__tests__/NodeHttpRouter.test.js index 00ed9df..8bac613 100644 --- a/dist/node/__tests__/NodeHttpRouter.test.js +++ b/dist/node/__tests__/NodeHttpRouter.test.js @@ -1,6 +1,6 @@ import { IncomingMessage, ServerResponse, } from 'http'; -import { ExactUrlPathnameMatcher, } from '../../matchers'; -import { NodeHttpRouter, } from '../NodeHttpRouter'; +import { ExactUrlPathnameMatcher, } from '../../matchers/index.js'; +import { NodeHttpRouter, } from '../NodeHttpRouter.js'; it('missing method in request', () => { const nodeRouter = new NodeHttpRouter(); expect(() => nodeRouter.serve({}, {})).toThrowError(`request missing 'method'`); diff --git a/dist/node/__tests__/NodeHttpRouter.test.js.map b/dist/node/__tests__/NodeHttpRouter.test.js.map index 641152e..82d359c 100644 --- a/dist/node/__tests__/NodeHttpRouter.test.js.map +++ b/dist/node/__tests__/NodeHttpRouter.test.js.map @@ -1 +1 @@ -{"version":3,"file":"NodeHttpRouter.test.js","sourceRoot":"","sources":["../../../src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AAC,UAAU,CAAC,CAAA;IACnH,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAqB,EAAE,EAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;AAC9H,CAAC,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"NodeHttpRouter.test.js","sourceRoot":"","sources":["../../../src/node/__tests__/NodeHttpRouter.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,eAAe,EACf,cAAc,GACd,MAAM,MAAM,CAAA;AACb,OAAO,EACN,uBAAuB,GACvB,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACN,cAAc,GACd,MAAM,sBAAsB,CAAA;AAE7B,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;IACpC,MAAM,UAAU,GAAG,IAAI,cAAc,EAAE,CAAA;IACvC,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAqB,EAAE,EAAoB,CAAC,CAAC,CAAC,YAAY,CAAC,0BAA0B,CAAC,CAAA;AACrH,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACjC,MAAM,UAAU,GAAG,IAAI,cAAc,EAAE,CAAA;IACvC,MAAM,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAqB,EAAE,EAAoB,CAAC,CAAC,CAAC,YAAY,CAAC,uBAAuB,CAAC,CAAA;AACjI,CAAC,CAAC,CAAA;AAEF,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC1B,MAAM,UAAU,GAAG,IAAI,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE;QAC3D,OAAO,kBAAkB,GAAG,CAAC,GAAG,EAAE,CAAA;IACnC,CAAC,CAAC,CAAA;IACF,UAAU,CAAC,QAAQ,CAAC;QACnB,OAAO,EAAE,IAAI,uBAAuB,CAAC,CAAC,OAAO,CAAC,CAAC;QAC/C,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU;KACzB,CAAC,CAAA;IAEF,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,OAAO,EAAqB,EAAE,EAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;IACnH,MAAM,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,EAAqB,EAAE,EAAoB,CAAC,CAAC,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAA;AAC9H,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/src/Router.ts b/src/Router.ts index a553d65..0f6d6ff 100644 --- a/src/Router.ts +++ b/src/Router.ts @@ -2,11 +2,11 @@ import { type Matched, type Matcher, isMatched, -} from './matchers' +} from './matchers/index.js' import { type MatchResult, type MatchResultAny, -} from './matchers/MatchResult' +} from './matchers/MatchResult.js' interface HandlerParams { match: Matched diff --git a/src/__tests__/Router.test.ts b/src/__tests__/Router.test.ts index a6b94ad..c575e8f 100644 --- a/src/__tests__/Router.test.ts +++ b/src/__tests__/Router.test.ts @@ -12,7 +12,7 @@ import type { import { type MatchedHandler, Router, -} from '../Router' +} from '../Router.js' import { type AndMatcherResult, EndpointMatcher, @@ -24,22 +24,22 @@ import { MethodMatcher, RegExpUrlMatcher, and, -} from '../matchers' +} from '../matchers/index.js' import type { ServerRequest, -} from '../node/ServerRequest' +} from '../node/ServerRequest.js' import type { MatchResult, -} from '../matchers/MatchResult' +} from '../matchers/MatchResult.js' import type { Matcher, -} from '../matchers/Matcher' +} from '../matchers/Matcher.js' import { BooleanMatcher, -} from '../matchers/BooleanMatcher' +} from '../matchers/BooleanMatcher.js' import { NodeHttpRouter, -} from '../node/NodeHttpRouter' +} from '../node/NodeHttpRouter.js' let router: Router<{ req: ServerRequest }> diff --git a/src/examples/micro.ts b/src/examples/micro.ts index e41f463..bc9b60a 100644 --- a/src/examples/micro.ts +++ b/src/examples/micro.ts @@ -6,13 +6,13 @@ import { import { EndpointMatcher, ExactUrlPathnameMatcher, -} from '../matchers' +} from '../matchers/index.js' import { BooleanMatcher, -} from '../matchers/BooleanMatcher' +} from '../matchers/BooleanMatcher.js' import { NodeHttpRouter, -} from '../node/NodeHttpRouter' +} from '../node/NodeHttpRouter.js' /* diff --git a/src/examples/node.ts b/src/examples/node.ts index 2180b54..7c41778 100644 --- a/src/examples/node.ts +++ b/src/examples/node.ts @@ -2,13 +2,13 @@ import http from 'http' import { EndpointMatcher, ExactUrlPathnameMatcher, -} from '../matchers' +} from '../matchers/index.js' import { BooleanMatcher, -} from '../matchers/BooleanMatcher' +} from '../matchers/BooleanMatcher.js' import { NodeHttpRouter, -} from '../node/NodeHttpRouter' +} from '../node/NodeHttpRouter.js' /* diff --git a/src/index.ts b/src/index.ts index c8978cc..c2317de 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,16 +1,16 @@ -export * from './matchers' -export * from './middlewares' +export * from './matchers/index.js' +export * from './middlewares/index.js' export { type Handler, type Route, type MatchedHandler, Router, -} from './Router' +} from './Router.js' export { type ServerRequest, toServerRequest, -} from './node/ServerRequest' +} from './node/ServerRequest.js' export { NodeHttpRouter, type NodeHttpRouterParams, -} from './node/NodeHttpRouter' +} from './node/NodeHttpRouter.js' diff --git a/src/matchers/AndMatcher.ts b/src/matchers/AndMatcher.ts index f6227c2..9764de1 100644 --- a/src/matchers/AndMatcher.ts +++ b/src/matchers/AndMatcher.ts @@ -1,12 +1,12 @@ import type { Matcher, -} from './Matcher' +} from './Matcher.js' import { type MatchResult, type MatchResultAny, type Matched, isMatched, -} from './MatchResult' +} from './MatchResult.js' export type AndMatcherResult< MR1 extends MatchResultAny | never = never, diff --git a/src/matchers/BooleanMatcher.ts b/src/matchers/BooleanMatcher.ts index 96de20a..d608484 100644 --- a/src/matchers/BooleanMatcher.ts +++ b/src/matchers/BooleanMatcher.ts @@ -1,9 +1,9 @@ import type { MatchResult, -} from './MatchResult' +} from './MatchResult.js' import type { Matcher, -} from './Matcher' +} from './Matcher.js' export class BooleanMatcher implements Matcher, void> { constructor(private value: T) { diff --git a/src/matchers/EndpointMatcher.ts b/src/matchers/EndpointMatcher.ts index ea8c33a..3c2deae 100644 --- a/src/matchers/EndpointMatcher.ts +++ b/src/matchers/EndpointMatcher.ts @@ -1,23 +1,23 @@ import type { Matcher, -} from './Matcher' +} from './Matcher.js' import type { MatchResult, -} from './MatchResult' +} from './MatchResult.js' import { type Method, type MethodMatchResult, MethodMatcher, -} from './MethodMatcher' +} from './MethodMatcher.js' import { type AndMatcher, and, -} from './AndMatcher' +} from './AndMatcher.js' import { type RegExpExecGroupArray, type RegExpUrlMatchResult, RegExpUrlMatcher, -} from './RegExpUrlMatcher' +} from './RegExpUrlMatcher.js' // waiting for // https://github.com/microsoft/TypeScript/issues/10571 diff --git a/src/matchers/ExactQueryMatcher.ts b/src/matchers/ExactQueryMatcher.ts index e3fab87..82a8093 100644 --- a/src/matchers/ExactQueryMatcher.ts +++ b/src/matchers/ExactQueryMatcher.ts @@ -1,10 +1,10 @@ import Url from 'urlite' import type { Matcher, -} from './Matcher' +} from './Matcher.js' import type { MatchResult, -} from './MatchResult' +} from './MatchResult.js' export interface ExactQueryMatcherInput { req: { diff --git a/src/matchers/ExactUrlPathnameMatcher.ts b/src/matchers/ExactUrlPathnameMatcher.ts index a51742e..b98ac6e 100644 --- a/src/matchers/ExactUrlPathnameMatcher.ts +++ b/src/matchers/ExactUrlPathnameMatcher.ts @@ -1,10 +1,10 @@ import Url from 'urlite' import type { Matcher, -} from './Matcher' +} from './Matcher.js' import type { MatchResult, -} from './MatchResult' +} from './MatchResult.js' export interface ExactUrlPathnameMatcherInput { req: { diff --git a/src/matchers/Matcher.ts b/src/matchers/Matcher.ts index aaced3f..9b5e70c 100644 --- a/src/matchers/Matcher.ts +++ b/src/matchers/Matcher.ts @@ -1,6 +1,6 @@ import type { MatchResultAny, -} from './MatchResult' +} from './MatchResult.js' // eslint-disable-next-line @typescript-eslint/no-explicit-any export type ExtractMatchResult = M extends Matcher ? MR : never diff --git a/src/matchers/MethodMatcher.ts b/src/matchers/MethodMatcher.ts index 4e749cb..533f68d 100644 --- a/src/matchers/MethodMatcher.ts +++ b/src/matchers/MethodMatcher.ts @@ -1,9 +1,9 @@ import type { Matcher, -} from './Matcher' +} from './Matcher.js' import type { MatchResult, -} from './MatchResult' +} from './MatchResult.js' const validMethods = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'] as const diff --git a/src/matchers/OrMatcher.ts b/src/matchers/OrMatcher.ts index 4113406..a98cd93 100644 --- a/src/matchers/OrMatcher.ts +++ b/src/matchers/OrMatcher.ts @@ -1,12 +1,12 @@ import type { Matcher, -} from './Matcher' +} from './Matcher.js' import { type MatchResult, type MatchResultAny, type Matched, isMatched, -} from './MatchResult' +} from './MatchResult.js' export type OrMatcherResult< MR1 extends MatchResultAny | never = never, diff --git a/src/matchers/RegExpUrlMatcher.ts b/src/matchers/RegExpUrlMatcher.ts index 33152ed..034f572 100644 --- a/src/matchers/RegExpUrlMatcher.ts +++ b/src/matchers/RegExpUrlMatcher.ts @@ -1,10 +1,10 @@ import Url from 'urlite' import type { Matcher, -} from './Matcher' +} from './Matcher.js' import type { MatchResult, -} from './MatchResult' +} from './MatchResult.js' export interface RegExpUrlMatcherInput { req: { diff --git a/src/matchers/__tests__/AndMatcher.test.ts b/src/matchers/__tests__/AndMatcher.test.ts index bdebf6f..f472f6e 100644 --- a/src/matchers/__tests__/AndMatcher.test.ts +++ b/src/matchers/__tests__/AndMatcher.test.ts @@ -6,10 +6,10 @@ import { ExactUrlPathnameMatcher, MethodMatcher, and, -} from '..' +} from '../index.js' import type { ServerRequest, -} from '../../node/ServerRequest' +} from '../../node/ServerRequest.js' it('none match', () => { const result = and([ diff --git a/src/matchers/__tests__/BooleanMatcher.test.ts b/src/matchers/__tests__/BooleanMatcher.test.ts index 8346c67..be487a0 100644 --- a/src/matchers/__tests__/BooleanMatcher.test.ts +++ b/src/matchers/__tests__/BooleanMatcher.test.ts @@ -1,6 +1,6 @@ import { bool, -} from '..' +} from '../index.js' it('match', () => { const result = bool(true) diff --git a/src/matchers/__tests__/EndpointMatcher.test.ts b/src/matchers/__tests__/EndpointMatcher.test.ts index 9243b94..5ebbbe4 100644 --- a/src/matchers/__tests__/EndpointMatcher.test.ts +++ b/src/matchers/__tests__/EndpointMatcher.test.ts @@ -3,10 +3,10 @@ import { } from 'node-mocks-http' import { endpoint, -} from '..' +} from '../index.js' import type { ServerRequest, -} from '../../node/ServerRequest' +} from '../../node/ServerRequest.js' it('not match empty', () => { const result = endpoint('GET', /\/test/) diff --git a/src/matchers/__tests__/ExactQueryMatcher.test.ts b/src/matchers/__tests__/ExactQueryMatcher.test.ts index 67c709e..10b5526 100644 --- a/src/matchers/__tests__/ExactQueryMatcher.test.ts +++ b/src/matchers/__tests__/ExactQueryMatcher.test.ts @@ -3,10 +3,10 @@ import { } from 'node-mocks-http' import { exactQuery, -} from '..' +} from '../index.js' import type { ServerRequest, -} from '../../node/ServerRequest' +} from '../../node/ServerRequest.js' const matcher = exactQuery({ mustPresent: true, diff --git a/src/matchers/__tests__/ExactUrlPathnameMatcher.test.ts b/src/matchers/__tests__/ExactUrlPathnameMatcher.test.ts index b638447..b5bbe33 100644 --- a/src/matchers/__tests__/ExactUrlPathnameMatcher.test.ts +++ b/src/matchers/__tests__/ExactUrlPathnameMatcher.test.ts @@ -3,10 +3,10 @@ import { } from 'node-mocks-http' import { exactUrlPathname, -} from '..' +} from '../index.js' import type { ServerRequest, -} from '../../node/ServerRequest' +} from '../../node/ServerRequest.js' it('not match empty', () => { const result = exactUrlPathname(['/test']) diff --git a/src/matchers/__tests__/MethodMatcher.test.ts b/src/matchers/__tests__/MethodMatcher.test.ts index d41498f..8ab25ef 100644 --- a/src/matchers/__tests__/MethodMatcher.test.ts +++ b/src/matchers/__tests__/MethodMatcher.test.ts @@ -3,10 +3,10 @@ import { } from 'node-mocks-http' import { method, -} from '../MethodMatcher' +} from '../MethodMatcher.js' import type { ServerRequest, -} from '../../node/ServerRequest' +} from '../../node/ServerRequest.js' it('not match', () => { const result = method(['POST']) diff --git a/src/matchers/__tests__/OrMatcher.test.ts b/src/matchers/__tests__/OrMatcher.test.ts index a01e7b0..519702d 100644 --- a/src/matchers/__tests__/OrMatcher.test.ts +++ b/src/matchers/__tests__/OrMatcher.test.ts @@ -5,10 +5,10 @@ import { ExactUrlPathnameMatcher, MethodMatcher, or, -} from '..' +} from '../index.js' import type { ServerRequest, -} from '../../node/ServerRequest' +} from '../../node/ServerRequest.js' it('none match', () => { const result = or([ diff --git a/src/matchers/__tests__/RegExpUrlMatcher.test.ts b/src/matchers/__tests__/RegExpUrlMatcher.test.ts index 76f0fcf..f8e693c 100644 --- a/src/matchers/__tests__/RegExpUrlMatcher.test.ts +++ b/src/matchers/__tests__/RegExpUrlMatcher.test.ts @@ -3,10 +3,10 @@ import { } from 'node-mocks-http' import { regExpUrl, -} from '..' +} from '../index.js' import type { ServerRequest, -} from '../../node/ServerRequest' +} from '../../node/ServerRequest.js' it('not match', () => { const result = regExpUrl([/^\/test$/]) diff --git a/src/matchers/index.ts b/src/matchers/index.ts index 59f5f1f..5d1684c 100644 --- a/src/matchers/index.ts +++ b/src/matchers/index.ts @@ -2,26 +2,26 @@ export { and, AndMatcher, type AndMatcherResult, -} from './AndMatcher' +} from './AndMatcher.js' export { endpoint, EndpointMatcher, type EndpointMatcherInput, -} from './EndpointMatcher' +} from './EndpointMatcher.js' export { exactQuery, ExactQueryMatcher, -} from './ExactQueryMatcher' +} from './ExactQueryMatcher.js' export { exactUrlPathname, ExactUrlPathnameMatcher, type ExactUrlPathnameMatcherInput, type ExactUrlPathnameMatchResult, -} from './ExactUrlPathnameMatcher' +} from './ExactUrlPathnameMatcher.js' export { type ExtractMatchResult, type Matcher, -} from './Matcher' +} from './Matcher.js' export { isMatched, type Matched, @@ -29,26 +29,26 @@ export { type MatchResultAny, type MatchedResult, type UnmatchedResult, -} from './MatchResult' +} from './MatchResult.js' export { method, type Method, MethodMatcher, type MethodMatcherInput, type MethodMatchResult, -} from './MethodMatcher' +} from './MethodMatcher.js' export { or, OrMatcher, type OrMatcherResult, -} from './OrMatcher' +} from './OrMatcher.js' export { regExpUrl, RegExpUrlMatcher, type RegExpUrlMatcherInput, type RegExpUrlMatchResult, -} from './RegExpUrlMatcher' +} from './RegExpUrlMatcher.js' export { bool, BooleanMatcher, -} from './BooleanMatcher' +} from './BooleanMatcher.js' diff --git a/src/middlewares/CorsMiddleware.ts b/src/middlewares/CorsMiddleware.ts index 47996f1..2b33f70 100644 --- a/src/middlewares/CorsMiddleware.ts +++ b/src/middlewares/CorsMiddleware.ts @@ -1,9 +1,9 @@ import type { MatchResultAny, -} from '../matchers/MatchResult' +} from '../matchers/MatchResult.js' import type { Handler, -} from '../Router' +} from '../Router.js' export interface CorsMiddlewareInput { headers: { diff --git a/src/middlewares/MiddlewareData.ts b/src/middlewares/MiddlewareData.ts index d331666..c9e58f4 100644 --- a/src/middlewares/MiddlewareData.ts +++ b/src/middlewares/MiddlewareData.ts @@ -1,9 +1,9 @@ import type { MatchResultAny, -} from '../matchers/MatchResult' +} from '../matchers/MatchResult.js' import type { Handler, -} from '../Router' +} from '../Router.js' export type MiddlewareData< // eslint-disable-next-line @typescript-eslint/no-explicit-any diff --git a/src/middlewares/__tests__/CorsMiddleware.test.ts b/src/middlewares/__tests__/CorsMiddleware.test.ts index 1d875c0..7612d37 100644 --- a/src/middlewares/__tests__/CorsMiddleware.test.ts +++ b/src/middlewares/__tests__/CorsMiddleware.test.ts @@ -7,7 +7,7 @@ import { } from '@jest/globals' import { CorsMiddleware, -} from '../CorsMiddleware' +} from '../CorsMiddleware.js' describe('simple configuration', () => { beforeEach(() => { diff --git a/src/middlewares/index.ts b/src/middlewares/index.ts index 6915ae7..66b4901 100644 --- a/src/middlewares/index.ts +++ b/src/middlewares/index.ts @@ -2,7 +2,7 @@ export { CorsMiddleware, type CorsMiddlewareCallbackResult, type CorsMiddlewareInput, -} from './CorsMiddleware' +} from './CorsMiddleware.js' export { type MiddlewareData, -} from './MiddlewareData' +} from './MiddlewareData.js' diff --git a/src/node/NodeHttpRouter.ts b/src/node/NodeHttpRouter.ts index 6fc2636..839fc6a 100644 --- a/src/node/NodeHttpRouter.ts +++ b/src/node/NodeHttpRouter.ts @@ -5,15 +5,15 @@ import { import type { MatchResult, MatchedResult, -} from '../matchers' +} from '../matchers/index.js' import { type Handler, Router, -} from '../Router' +} from '../Router.js' import { type ServerRequest, toServerRequest, -} from './ServerRequest' +} from './ServerRequest.js' interface ServerRequestResponse { req: ServerRequest diff --git a/src/node/__tests__/NodeHttpRouter.test.ts b/src/node/__tests__/NodeHttpRouter.test.ts index 04d3cdf..5e9216c 100644 --- a/src/node/__tests__/NodeHttpRouter.test.ts +++ b/src/node/__tests__/NodeHttpRouter.test.ts @@ -4,10 +4,10 @@ import { } from 'http' import { ExactUrlPathnameMatcher, -} from '../../matchers' +} from '../../matchers/index.js' import { NodeHttpRouter, -} from '../NodeHttpRouter' +} from '../NodeHttpRouter.js' it('missing method in request', () => { const nodeRouter = new NodeHttpRouter()