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

inert

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

inert - npm Package Compare versions

Comparing version 5.1.2 to 5.1.3

CHANGELOG.md

33

lib/directory.js

@@ -30,13 +30,4 @@ 'use strict';

internals.normalizePaths = function (basePath, paths) {
internals.resolvePathOption = function (result) {
return paths.map((path) => {
return Path.isAbsolute(path) ? path : Path.join(basePath, path);
});
};
internals.resolvePathOption = function (basePath, result) {
if (result instanceof Error) {

@@ -46,14 +37,11 @@ throw result;

let paths;
if (typeof result === 'string') {
paths = [result];
return [result];
}
else if (Array.isArray(result)) {
paths = result;
if (Array.isArray(result)) {
return result;
}
else {
throw Boom.internal('Invalid path function');
}
return internals.normalizePaths(basePath, paths);
throw Boom.internal('Invalid path function');
};

@@ -69,3 +57,4 @@

const basePath = route.settings.files.relativeTo;
const normalized = (Array.isArray(settings.path) ? internals.normalizePaths(basePath, settings.path) : null); // Array or function
const normalized = (Array.isArray(settings.path) ? settings.path : null); // Array or function
const indexNames = (settings.index === true) ? ['index.html'] : (settings.index || []);

@@ -77,3 +66,3 @@

const paths = normalized || internals.resolvePathOption(basePath, settings.path.call(null, request));
const paths = normalized || internals.resolvePathOption(settings.path.call(null, request));

@@ -159,3 +148,3 @@ // Append parameter

if (settings.listing) {
return internals.generateListing(Path.join(baseDir, path), resource, selection, hasTrailingSlash, settings, request);
return internals.generateListing(Path.join(basePath, baseDir, path), resource, selection, hasTrailingSlash, settings, request);
}

@@ -214,3 +203,3 @@ }

html = html + '<li><a href="' + internals.pathEncode(resource + (selection && !hasTrailingSlash ? '/' : '') + files[i]) + '">' + Hoek.escapeHtml(files[i]) + '</a></li>';
html = html + '<li><a href="' + internals.pathEncode(resource + (!hasTrailingSlash ? '/' : '') + files[i]) + '">' + Hoek.escapeHtml(files[i]) + '</a></li>';
}

@@ -217,0 +206,0 @@ }

{
"name": "inert",
"description": "Static file and directory handlers plugin for hapi.js",
"version": "5.1.2",
"version": "5.1.3",
"repository": "https://github.com/hapijs/inert.git",

@@ -24,4 +24,4 @@ "main": "lib/index.js",

"code": "5.x.x",
"hapi": "17.x.x",
"lab": "17.x.x"
"hapi": "18.x.x",
"lab": "18.x.x"
},

@@ -28,0 +28,0 @@ "scripts": {

Sorry, the diff of this file is not supported yet

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