@spirobel/mininext 0.7.4 → 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 CHANGED
@@ -11,9 +11,9 @@ import { html, json, dangerjson, HtmlString } from "./html";
11
11
  import { BasedHtml, type DangerJsonInHtml, type JsonString, type JsonStringValues } from "./html";
12
12
  export type HTTPMethod = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
13
13
  export type MiniNextRouteHandlerObject<T extends string> = {
14
- [K in HTTPMethod]?: HtmlHandler<unknown, T> | HtmlHandler;
14
+ [K in HTTPMethod]?: HtmlHandler<unknown, T>;
15
15
  };
16
- export type MiniNextRouteValue<T extends string> = HtmlHandler<unknown, T> | HtmlHandler | MiniNextRouteHandlerObject<T>;
16
+ export type MiniNextRouteValue<T extends string> = HtmlHandler<unknown, T> | MiniNextRouteHandlerObject<T>;
17
17
  export type BunRoutes<R extends {
18
18
  [K in keyof R]: RouterTypes.RouteValue<Extract<K, string>>;
19
19
  }> = R;
@@ -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(url.get(Url) || "/url_not_found_error", GOOFY_HACK);
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;
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "clean": "rm -rf ./dist"
12
12
  },
13
13
  "files": ["dist"],
14
- "version": "0.7.4",
14
+ "version": "0.7.6",
15
15
  "devDependencies": {
16
16
  "@types/bun": "^1.2.9"
17
17
  },