glob-to-routes
Advanced tools
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" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3937
1
25
+ Addedglob@^10.2.2
+ Added@isaacs/cliui@8.0.2(transitive)
+ Added@pkgjs/parseargs@0.11.0(transitive)
+ Addedansi-regex@5.0.16.1.0(transitive)
+ Addedansi-styles@4.3.06.2.1(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@2.0.1(transitive)
+ Addedcolor-convert@2.0.1(transitive)
+ Addedcolor-name@1.1.4(transitive)
+ Addedcross-spawn@7.0.6(transitive)
+ Addedeastasianwidth@0.2.0(transitive)
+ Addedemoji-regex@8.0.09.2.2(transitive)
+ Addedforeground-child@3.3.0(transitive)
+ Addedglob@10.4.5(transitive)
+ Addedis-fullwidth-code-point@3.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedjackspeak@3.4.3(transitive)
+ Addedlru-cache@10.4.3(transitive)
+ Addedminimatch@9.0.5(transitive)
+ Addedminipass@7.1.2(transitive)
+ Addedpackage-json-from-dist@1.0.1(transitive)
+ Addedpath-key@3.1.1(transitive)
+ Addedpath-scurry@1.11.1(transitive)
+ Addedshebang-command@2.0.0(transitive)
+ Addedshebang-regex@3.0.0(transitive)
+ Addedsignal-exit@4.1.0(transitive)
+ Addedstring-width@4.2.35.1.2(transitive)
+ Addedstrip-ansi@6.0.17.1.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwrap-ansi@7.0.08.1.0(transitive)