vovk 3.0.0-draft.139 → 3.0.0-draft.141
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/client/fetcher.js +3 -1
- package/mjs/client/fetcher.js +3 -1
- package/package.json +1 -1
package/cjs/client/fetcher.js
CHANGED
|
@@ -11,7 +11,9 @@ function createFetcher({ prepareRequestInit, transformResponse, } = {}) {
|
|
|
11
11
|
const newFetcher = async ({ httpMethod, getEndpoint, validate, defaultHandler, defaultStreamHandler }, options) => {
|
|
12
12
|
const { params, query, body, apiRoot = '/api', disableClientValidation, init, interpretAs } = options;
|
|
13
13
|
const endpoint = getEndpoint({ apiRoot, params, query });
|
|
14
|
-
const unusedParams = new URL(endpoint
|
|
14
|
+
const unusedParams = new URL(endpoint.startsWith('/') ? `http://localhost${endpoint}` : endpoint).pathname
|
|
15
|
+
.split('/')
|
|
16
|
+
.filter((segment) => segment.startsWith(':'));
|
|
15
17
|
if (unusedParams.length) {
|
|
16
18
|
throw new HttpException_js_1.HttpException(types_js_1.HttpStatus.NULL, `Unused params: ${unusedParams.join(', ')} in ${endpoint}`, {
|
|
17
19
|
body,
|
package/mjs/client/fetcher.js
CHANGED
|
@@ -11,7 +11,9 @@ function createFetcher({ prepareRequestInit, transformResponse, } = {}) {
|
|
|
11
11
|
const newFetcher = async ({ httpMethod, getEndpoint, validate, defaultHandler, defaultStreamHandler }, options) => {
|
|
12
12
|
const { params, query, body, apiRoot = '/api', disableClientValidation, init, interpretAs } = options;
|
|
13
13
|
const endpoint = getEndpoint({ apiRoot, params, query });
|
|
14
|
-
const unusedParams = new URL(endpoint
|
|
14
|
+
const unusedParams = new URL(endpoint.startsWith('/') ? `http://localhost${endpoint}` : endpoint).pathname
|
|
15
|
+
.split('/')
|
|
16
|
+
.filter((segment) => segment.startsWith(':'));
|
|
15
17
|
if (unusedParams.length) {
|
|
16
18
|
throw new HttpException_js_1.HttpException(types_js_1.HttpStatus.NULL, `Unused params: ${unusedParams.join(', ')} in ${endpoint}`, {
|
|
17
19
|
body,
|