Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hono-router

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hono-router - npm Package Compare versions

Comparing version 1.0.4 to 1.0.5

24

index.js

@@ -57,3 +57,3 @@ #!/usr/bin/env node

*/
const generateRoutes = (dir, out) => {
const generateRoutes = (dir, out, isDeno) => {
/** @type {string[]} */

@@ -74,5 +74,7 @@ const imports = [];

const entryPath = path.join(currentPath, entry.name);
const importPath = path
let importPath = path
.join(basePath, entry.name)
.replace(/\.(ts|tsx)$/, '');
if (!isDeno){
importPath = importPath.replace(/\.(ts|tsx)$/, '');
}
if (entry.isDirectory()) {

@@ -92,3 +94,3 @@ traverseDirectories(entryPath, importPath);

.replace(/\[(.+?)\]/g, '$1'); // Ensure valid variable names
const importPathString = importPath.replace(/index$/, '');
const importPathString = isDeno ? importPath : importPath.replace(/index$/, '');
const relativePath = path

@@ -165,3 +167,11 @@ .relative(path.dirname(out), path.join(dir, importPathString))

const [routesDir, outputFile] = process.argv.slice(2);
const args = process.argv.slice(2);
const denoFlagIndex = args.indexOf('--deno');
const isDeno = denoFlagIndex !== -1;
if (isDeno) {
args.splice(denoFlagIndex, 1); // Remove the --deno flag from the arguments
}
const [routesDir, outputFile] = args;
if (!routesDir || !outputFile) {

@@ -177,3 +187,3 @@ console.error(

// Initial generation
generateRoutes(routesDir, outputFile);
generateRoutes(routesDir, outputFile, isDeno);

@@ -187,3 +197,3 @@ // Watch mode

);
generateRoutes(routesDir, outputFile);
generateRoutes(routesDir, outputFile, isDeno);
});
{
"name": "hono-router",
"version": "1.0.4",
"version": "1.0.5",
"description": "hotloading script to generate file-based routing config for Hono",

@@ -5,0 +5,0 @@ "author": "Stu Kennedy",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc