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

brembo

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

brembo - npm Package Compare versions

Comparing version 2.1.1 to 2.1.2

39

index.js
const build = function(base, options) {
let urlOut = "";
const params = options.params;
let path = options.path;
let path = options.path || [];
const canonical = !!options.canonical;

@@ -10,7 +10,13 @@ const anchor = options.anchor;

if (str[str.length - 1] == "/") {
if (str == null || str === "") {
return null;
}
str = str.toString().trim();
if (str[str.length - 1] === "/") {
str = str.slice(0, str.length - 1);
}
if (str[0] == "/") {
if (str[0] === "/") {
str = str.slice(1, str.length);

@@ -22,25 +28,16 @@ }

if (base){
urlOut = urlOut.concat(base);
if (typeof(path) === "string") {
path = path.split("/");
}
if (path){
if (typeof path == "string") {
path = [path];
}
path = [base || ""].concat(path).map(trimSlashes).filter(i => !!i);
path = path.map(item => trimSlashes(item.toString().trim())).join("/");
urlOut = path.join("/");
if (canonical) {
const last = path.split("/").pop();
const isFile = last.includes(".");
if (canonical && !path[path.length - 1].includes(".")) { // Not a file
urlOut = urlOut + "/";
}
if (!isFile) {
path = path + "/";
}
}
if (path.length) {
urlOut = trimSlashes(base).concat("/" + path.toString());
}
if (!base || base === "/") {
urlOut = "/" + urlOut;
}

@@ -47,0 +44,0 @@

{
"name": "brembo",
"version": "2.1.1",
"version": "2.1.2",
"description": "A simple utility for building URLs",

@@ -5,0 +5,0 @@ "main": "index.js",

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