Socket
Socket
Sign inDemoInstall

@jsenv/url-meta

Package Overview
Dependencies
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jsenv/url-meta - npm Package Compare versions

Comparing version 8.0.0 to 8.1.0

2

package.json
{
"name": "@jsenv/url-meta",
"version": "8.0.0",
"version": "8.1.0",
"license": "MIT",

@@ -5,0 +5,0 @@ "repository": {

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

consumePattern(1) // consumes "/"
// when remainingPattern was preceeded by "**/"
// and remainingString have no "/"
// then skip is not allowed, a regular match will be performed
if (!remainingString.includes("/")) {

@@ -138,3 +141,3 @@ skipAllowed = false

}
// pattern ending with "**" or "**/" always match remaining string
// pattern ending with "**" or "**/" match remaining string
if (remainingPattern === "") {

@@ -160,3 +163,3 @@ consumeRemainingString()

if (remainingPattern === "") {
// matches everything except '/'
// matches everything except "/"
const slashIndex = remainingString.indexOf("/")

@@ -207,2 +210,16 @@ if (slashIndex === -1) {

let longestAttemptRange = null
let isLastAttempt = false
const failure = () => {
return {
matched: false,
patternIndex: longestAttemptRange.patternIndex,
index: longestAttemptRange.index + longestAttemptRange.length,
groups: longestAttemptRange.groups,
group: {
string: string.slice(0, longestAttemptRange.index),
},
}
}
const tryToMatch = () => {

@@ -237,28 +254,24 @@ const matchAttempt = applyMatching(pattern, remainingString)

}
if (isLastAttempt) {
return failure()
}
const nextIndex = attemptIndex + 1
let canSkip
if (nextIndex >= remainingString.length) {
canSkip = false
} else if (remainingString[0] === "/" && !canSkipSlash) {
canSkip = false
} else {
canSkip = true
return failure()
}
if (canSkip) {
// search against the next unattempted string
index += nextIndex
remainingString = remainingString.slice(nextIndex)
return tryToMatch()
if (remainingString[0] === "/") {
if (!canSkipSlash) {
return failure()
}
// when it's the last slash, the next attempt is the last
if (remainingString.indexOf("/", 1) === -1) {
isLastAttempt = true
}
}
return {
matched: false,
patternIndex: longestAttemptRange.patternIndex,
index: longestAttemptRange.index + longestAttemptRange.length,
groups: longestAttemptRange.groups,
group: {
string: string.slice(0, longestAttemptRange.index),
},
}
// search against the next unattempted string
index += nextIndex
remainingString = remainingString.slice(nextIndex)
return tryToMatch()
}
return tryToMatch()
}
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