Comparing version 1.0.0-next.1 to 1.0.0-next.2
15
index.js
const fs = require('fs'); | ||
const { join, resolve } = require('path'); | ||
const list = require('totalist/sync'); | ||
const parser = require('@polka/url'); | ||
@@ -50,14 +51,2 @@ const mime = require('mime/lite'); | ||
function list(dir, fn, pre='') { | ||
let i=0, abs, stats; | ||
let arr = fs.readdirSync(dir); | ||
for (; i < arr.length; i++) { | ||
abs = join(dir, arr[i]); | ||
stats = fs.statSync(abs); | ||
stats.isDirectory() | ||
? list(abs, fn, join(pre, arr[i])) | ||
: fn(join(pre, arr[i]), abs, stats); | ||
} | ||
} | ||
function send(req, res, file, stats, headers={}) { | ||
@@ -130,3 +119,3 @@ let code=200, tmp, opts={} | ||
list(dir, (name, abs, stats) => { | ||
if (!opts.dotfiles && name.charAt(0) === '.') return; | ||
if (!opts.dotfiles && /(^\.|[\\+|\/+]\.)/.test(name)) return; | ||
@@ -133,0 +122,0 @@ let headers = toHeaders(name, stats, isEtag); |
{ | ||
"name": "sirv", | ||
"version": "1.0.0-next.1", | ||
"version": "1.0.0-next.2", | ||
"description": "The optimized & lightweight middleware for serving requests to static assets", | ||
@@ -19,6 +19,7 @@ "repository": "lukeed/sirv", | ||
"dependencies": { | ||
"@polka/url": "^1.0.0-next.3", | ||
"mime": "^2.3.1" | ||
"@polka/url": "^1.0.0-next.9", | ||
"mime": "^2.3.1", | ||
"totalist": "^1.0.0" | ||
}, | ||
"gitHead": "88b15bc2161fec6e015f32d8fbce3c52618793e7" | ||
"gitHead": "78f9157a13e741e11a261ac81e2975907808168a" | ||
} |
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
11485
3
115
+ Addedtotalist@^1.0.0
+ Addedtotalist@1.1.0(transitive)
Updated@polka/url@^1.0.0-next.9