baraqex 1.0.69 → 1.0.71

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/index.js CHANGED
@@ -694,46 +694,24 @@ var init_api_router = __esm({
694
694
  try {
695
695
  const absolutePath = path.isAbsolute(filePath) ? filePath : path.resolve(filePath);
696
696
  const fileUrl = pathToFileURL(absolutePath).href;
697
- if (process.platform === "win32") {
698
- const urlWithTimestamp = `${fileUrl}?t=${Date.now()}`;
699
- const routeModule = await import(urlWithTimestamp);
700
- if (!this.isValidRouteModule(routeModule)) {
701
- console.warn(`Invalid route module: ${filePath}`);
702
- return;
703
- }
704
- console.log(`Registering API route: ${routePath}`);
705
- const middleware = routeModule.middleware || [];
706
- for (const method of ["get", "post", "put", "delete", "patch", "options"]) {
707
- const handler = routeModule[method];
708
- if (typeof handler === "function") {
709
- const routerMethod = this.router[method];
710
- routerMethod.call(
711
- this.router,
712
- routePath,
713
- ...middleware,
714
- this.wrapHandler(handler)
715
- );
716
- }
717
- }
718
- } else {
719
- const routeModule = await import(fileUrl);
720
- if (!this.isValidRouteModule(routeModule)) {
721
- console.warn(`Invalid route module: ${filePath}`);
722
- return;
723
- }
724
- console.log(`Registering API route: ${routePath}`);
725
- const middleware = routeModule.middleware || [];
726
- for (const method of ["get", "post", "put", "delete", "patch", "options"]) {
727
- const handler = routeModule[method];
728
- if (typeof handler === "function") {
729
- const routerMethod = this.router[method];
730
- routerMethod.call(
731
- this.router,
732
- routePath,
733
- ...middleware,
734
- this.wrapHandler(handler)
735
- );
736
- }
697
+ const urlWithTimestamp = `${fileUrl}?t=${Date.now()}`;
698
+ const routeModule = await import(urlWithTimestamp);
699
+ if (!this.isValidRouteModule(routeModule)) {
700
+ console.warn(`Invalid route module: ${filePath}`);
701
+ return;
702
+ }
703
+ console.log(`Registering API route: ${routePath}`);
704
+ const middleware = routeModule.middleware || [];
705
+ for (const method of ["get", "post", "put", "delete", "patch", "options"]) {
706
+ const handler = routeModule[method];
707
+ if (typeof handler === "function") {
708
+ const routerMethod = this.router[method];
709
+ routerMethod.call(
710
+ this.router,
711
+ routePath,
712
+ ...middleware,
713
+ this.wrapHandler(handler)
714
+ );
737
715
  }
738
716
  }
739
717
  } catch (error) {