New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

query-path

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

query-path - npm Package Compare versions

Comparing version 1.0.3 to 1.0.5

36

index.js

@@ -20,3 +20,3 @@ 'use strict';

} else {
pathname = window.location.pathname;
pathname = (typeof window !== "undefined")?window.location.pathname:'';
}

@@ -30,20 +30,20 @@ pathname = _.compact(pathname.split('/'));

exports.pathByMatchingString = function(matchingString, url) {
var pathname = '';
var retVal = [];
if (url) {
pathname = url;
} else {
pathname = window.location.pathname;
}
pathname = _.compact(pathname.split('/'));
if (matchingString && !_.isEmpty(pathname) {
_.each(pathname, function(val, i) {
if (val.indexOf(matchingString) >= 0) {
retVal.push[val];
}
});
exports.pathByRegex = function(matchingString, url) {
var pathname = '';
var retVal = [];
if (url) {
pathname = url.split('?')[0];;
} else {
pathname = (typeof window !== "undefined")?window.location.pathname:'';
}
pathname = _.compact(pathname.split('/'));
if (matchingString && !_.isEmpty(pathname)) {
_.each(pathname, function(val, i) {
if (val.indexOf(matchingString) >= 0) {
retVal.push(val);
}
});
}
return retVal;
}
return retVal;
}
{
"name": "query-path",
"version": "1.0.3",
"version": "1.0.5",
"description": "helper methods to work with URL query string and pathname",

@@ -5,0 +5,0 @@ "license": "MIT",

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