@spirobel/mininext 0.7.5 → 0.7.6
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/dist/url.d.ts +0 -7
- package/dist/url.js +1 -14
- package/package.json +1 -1
package/dist/url.d.ts
CHANGED
|
@@ -255,13 +255,6 @@ export declare class url {
|
|
|
255
255
|
* @returns {string[]} - returns array of variations (added slash in the beginning, added, removed slash at the end)
|
|
256
256
|
*/
|
|
257
257
|
static generateVariations(inputString: string): string[];
|
|
258
|
-
/**
|
|
259
|
-
* This method retrieves a url from the urls array. If the url does not exist in the urls array, null will be returned.
|
|
260
|
-
* @param {string} Url - The url to retrieve.
|
|
261
|
-
* @return {string} - The retrieved url.
|
|
262
|
-
* @throws Will throw an Error if the provided url is not found in the urls array.
|
|
263
|
-
*/
|
|
264
|
-
static get(Url: string): string | null;
|
|
265
258
|
static handleWithMini(req: BunRequest<string>, server: Server, handler: HtmlHandler): Promise<Response>;
|
|
266
259
|
/**
|
|
267
260
|
* use this to set the Websocket object. Check out [the bun docs](https://bun.sh/docs/api/websockets) for more details.
|
package/dist/url.js
CHANGED
|
@@ -323,7 +323,7 @@ export class url {
|
|
|
323
323
|
// Create a new URL object from the current location
|
|
324
324
|
// https://github.com/whatwg/url/issues/531#issuecomment-1337050285
|
|
325
325
|
const GOOFY_HACK = "http://goofyhack.com";
|
|
326
|
-
const updatedUrl = new URL(
|
|
326
|
+
const updatedUrl = new URL(Url, GOOFY_HACK);
|
|
327
327
|
for (const q of qs) {
|
|
328
328
|
// Use URLSearchParams to set the name query parameter
|
|
329
329
|
const reqParam = new URL(req.url).searchParams.get(q);
|
|
@@ -372,19 +372,6 @@ export class url {
|
|
|
372
372
|
}
|
|
373
373
|
return variations;
|
|
374
374
|
}
|
|
375
|
-
/**
|
|
376
|
-
* This method retrieves a url from the urls array. If the url does not exist in the urls array, null will be returned.
|
|
377
|
-
* @param {string} Url - The url to retrieve.
|
|
378
|
-
* @return {string} - The retrieved url.
|
|
379
|
-
* @throws Will throw an Error if the provided url is not found in the urls array.
|
|
380
|
-
*/
|
|
381
|
-
static get(Url) {
|
|
382
|
-
const foundUrl = url.direct_handlers_html.get(url.generateVariations(Url)[0]);
|
|
383
|
-
if (!foundUrl) {
|
|
384
|
-
return null;
|
|
385
|
-
}
|
|
386
|
-
return Url;
|
|
387
|
-
}
|
|
388
375
|
static async handleWithMini(req, server, handler) {
|
|
389
376
|
if (!url.server)
|
|
390
377
|
url.server = server;
|