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 7.1.0 to 8.0.0

2

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

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

@@ -130,6 +130,10 @@ /*

consumePattern(2) // consumes "**"
let skipAllowed = true
if (remainingPattern[0] === "/") {
consumePattern(1) // consumes "/"
if (!remainingString.includes("/")) {
skipAllowed = false
}
}
// pattern ending with ** always match remaining string
// pattern ending with "**" or "**/" always match remaining string
if (remainingPattern === "") {

@@ -139,12 +143,14 @@ consumeRemainingString()

}
const skipResult = skipUntilMatch({
pattern: remainingPattern,
string: remainingString,
canSkipSlash: true,
})
groups.push(...skipResult.groups)
consumePattern(skipResult.patternIndex)
consumeRemainingString()
restoreIndexes = false
return skipResult.matched
if (skipAllowed) {
const skipResult = skipUntilMatch({
pattern: remainingPattern,
string: remainingString,
canSkipSlash: true,
})
groups.push(...skipResult.groups)
consumePattern(skipResult.patternIndex)
consumeRemainingString()
restoreIndexes = false
return skipResult.matched
}
}

@@ -199,3 +205,3 @@ if (remainingPattern[0] === "*") {

let remainingString = string
let longestMatchRange = null
let longestAttemptRange = null
const tryToMatch = () => {

@@ -217,16 +223,24 @@ const matchAttempt = applyMatching(pattern, remainingString)

}
const matchAttemptIndex = matchAttempt.index
const matchRange = {
const attemptIndex = matchAttempt.index
const attemptRange = {
patternIndex: matchAttempt.patternIndex,
index,
length: matchAttemptIndex,
length: attemptIndex,
groups: matchAttempt.groups,
}
if (!longestMatchRange || longestMatchRange.length < matchRange.length) {
longestMatchRange = matchRange
if (
!longestAttemptRange ||
longestAttemptRange.length < attemptRange.length
) {
longestAttemptRange = attemptRange
}
const nextIndex = matchAttemptIndex + 1
const canSkip =
nextIndex < remainingString.length &&
(canSkipSlash || remainingString[0] !== "/")
const nextIndex = attemptIndex + 1
let canSkip
if (nextIndex >= remainingString.length) {
canSkip = false
} else if (remainingString[0] === "/" && !canSkipSlash) {
canSkip = false
} else {
canSkip = true
}
if (canSkip) {

@@ -240,7 +254,7 @@ // search against the next unattempted string

matched: false,
patternIndex: longestMatchRange.patternIndex,
index: longestMatchRange.index + longestMatchRange.length,
groups: longestMatchRange.groups,
patternIndex: longestAttemptRange.patternIndex,
index: longestAttemptRange.index + longestAttemptRange.length,
groups: longestAttemptRange.groups,
group: {
string: string.slice(0, longestMatchRange.index),
string: string.slice(0, longestAttemptRange.index),
},

@@ -247,0 +261,0 @@ }

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