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

@websdk/rhumb

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@websdk/rhumb - npm Package Compare versions

Comparing version 0.3.8 to 0.3.9-support-root-paths.1

45

lib/rhumb.js

@@ -65,6 +65,2 @@ (function (global, factory) {

function isArr(inst) {
return inst instanceof Array;
}
function create() {

@@ -79,3 +75,3 @@ var router = {},

if (isArr(part)) {
if (Array.isArray(part)) {
node.leaf = fn;

@@ -86,12 +82,14 @@ updateTree(part, node, fn);

if (!part) {
return;
}
if (!part) return;
if (part.type == "fixed") {
node["fixed"] || (node["fixed"] = {});
if (part.type === "fixed") {
node.fixed || (node.fixed = {});
peek = node.fixed[part.input] || (node.fixed[part.input] = {});
} else if (part.type == "var") {
if (peek.leaf && !more) {
throw new Error("Ambiguity");
}
} else if (part.type === "var") {
if (node['var']) {
if (node['var'].name == part.input) {
if (node['var'].name === part.input) {
peek = node['var'];

@@ -137,3 +135,3 @@ } else {

var split = path.split("?").filter(falsy),
parts = split[0].split("/").filter(falsy),
parts = ['/'].concat(split[0].split("/").filter(falsy)),
params = parseQueryString(split[1]),

@@ -171,10 +169,4 @@ match = findIn(parts, tree);

bracks = /^[)]+/;
return ~ptn.indexOf('(') ? parseOptional(ptn) : parsePtn(ptn);
if (ptn.trim() == "/") {
return [{
type: "fixed",
input: ""
}];
}
function parseVar(part) {

@@ -231,3 +223,3 @@ var match = part.match(variable);

function parsePtn(ptn) {
return ptn.split("/").filter(falsy).map(function (d) {
return ['/'].concat(ptn.split("/")).filter(falsy).map(function (d) {
if (variable.test(d)) {

@@ -250,7 +242,6 @@ return parseVar(d);

len = ptn.length,
curr,
onePart = true;
while (onePart && i < len) {
curr = ptn[i];
var curr = ptn.charAt(i);

@@ -272,3 +263,3 @@ switch (curr) {

if (!onePart) {
var next = parseOptional(ptn.substr(i + 1));
var next = parseOptional(ptn.substr(i + 1)).slice(1);

@@ -282,8 +273,2 @@ if (next.length) {

}
if (ptn.indexOf("(") == -1) {
return parsePtn(ptn);
}
return parseOptional(ptn);
}

@@ -290,0 +275,0 @@

{
"name": "@websdk/rhumb",
"version": "0.3.8",
"version": "0.3.9-support-root-paths.1",
"description": "URL routing in js",

@@ -5,0 +5,0 @@ "main": "lib/rhumb.js",

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