Socket
Socket
Sign inDemoInstall

loader-runner

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loader-runner - npm Package Compare versions

Comparing version 2.0.0 to 2.0.1

18

lib/LoaderRunner.js

@@ -5,3 +5,2 @@ /*

*/
var path = require("path");
var fs = require("fs");

@@ -26,2 +25,15 @@ var readFile = fs.readFile.bind(fs);

function dirname(path) {
if(path === "/") return "/";
var i = path.lastIndexOf("/");
var j = path.lastIndexOf("\\");
var i2 = path.indexOf("/");
var j2 = path.indexOf("\\");
var idx = i > j ? i : j;
var idx2 = i > j ? i2 : j2;
if(idx < 0) return path;
if(idx === idx2) return path.substr(0, idx + 1);
return path.substr(0, idx);
}
function createLoaderObject(loader) {

@@ -200,3 +212,3 @@ var splittedRequest = splitQuery(loader);

var splitted = splitQuery(resource);
return path.dirname(splitted[0]);
return dirname(splitted[0]);
}

@@ -215,3 +227,3 @@

var resourceQuery = splittedResource ? splittedResource[1] : undefined;
var contextDirectory = resourcePath ? path.dirname(resourcePath) : null;
var contextDirectory = resourcePath ? dirname(resourcePath) : null;

@@ -218,0 +230,0 @@ // execution state

4

package.json
{
"name": "loader-runner",
"version": "2.0.0",
"version": "2.0.1",
"description": "Runs (webpack) loaders",

@@ -13,3 +13,3 @@ "main": "lib/LoaderRunner.js",

"precover": "npm run lint && npm run beautify-lint",
"cover": "istanbul cover node_modules/mocha/bin/_mocha -- -R spec",
"cover": "istanbul cover node_modules/mocha/bin/_mocha",
"travis": "npm run cover -- --report lcovonly"

@@ -16,0 +16,0 @@ },

@@ -290,5 +290,7 @@ var should = require("should");

var TESTS = [
["/", "/"],
["/path/file.js", "/path"],
["/some/longer/path/file.js", "/some/longer/path"],
["/file.js", "/"],
["C:\\", "C:\\"],
["C:\\file.js", "C:\\"],

@@ -295,0 +297,0 @@ ["C:\\some\\path\\file.js", "C:\\some\\path"],

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