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

glob-to-routes

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-to-routes - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

21

index.js
import path from 'node:path'
import glob from 'glob'
import { glob } from 'glob'

@@ -16,16 +16,7 @@ export function defaultConversionFunction(filePath) {

const dir = path.resolve(process.cwd(), baseDir)
return new Promise((resolve, reject) => {
glob(globPath, { cwd: dir }, (err, files) => {
if (err) {
reject(err)
} else {
resolve(
files.map(filePath => ({
route: conversionFunc(filePath),
filePath: path.resolve(dir, filePath),
}))
)
}
})
})
const files = await glob(globPath, { cwd: dir })
return files.map(filePath => ({
route: conversionFunc(filePath),
filePath: path.resolve(dir, filePath),
}))
}
{
"name": "glob-to-routes",
"version": "1.0.3",
"version": "1.0.4",
"description": "A simple utility for converting globs to route paths to be used with your routing system",

@@ -28,3 +28,6 @@ "exports": "./index.js",

},
"homepage": "https://github.com/wethrift/glob-to-routes#readme"
"homepage": "https://github.com/wethrift/glob-to-routes#readme",
"dependencies": {
"glob": "^10.2.2"
}
}
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