
Research
5 Malicious Chrome Extensions Enable Session Hijacking in Enterprise HR and ERP Systems
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.
@hatsy/route-match
Advanced tools
import { matchSimpleRoute } from '@hatsy/route-match';
const match = matchSimpleRoute('some/long/path/to/file.txt', 'some/**/{file}');
/*
match = {
$1: "long/path/to/",
file: "file.txt",
}
*/
Simple pattern can only match against whole entries (files or directories). Pattern format:
/ matches directory separator./* matches any route entry./{capture} captures any route entry as capture./** matches any number of directories./{capture:**} captures any number of directories as capture.The path can be specified as a string, as URL, or as a PathRoute instance. The latter can be constructed by urlRoute() function.
The pattern can be specified as a string, or as a RoutePattern instance. The latter can be constructed by simpleRoutePattern() function.
import { matchURLRoute } from '@hatsy/route-match';
const match = matchURLRoute('some-dir/long/path/to/file.html?param=value', '{root([^-]*)}-dir/**/{name}.{ext}?param');
/*
match = {
root: "some",
$1: "long/path/to/",
name: "file",
ext: "txt",
}
*/
URL pattern can match against any part of the entry name. Additionally, it can match against URL search parameters.
Pattern format:
/ matches directory separator.* matches a part of route entry name.{capture} captures a part of entry name as capture./** matches any number of directories./{capture:**} captures any number of directories as capture.{(regexp)flags} matches a part of entry name matching the given regular expression with optional flags.{capture(regexp)flags} captures a part of entry name matching the regular expression with optional flags.?name requires URL search parameter to present.?name=value requires URL search parameter to have the given value.The path can be specified as a string, as URL, or as an URLRoute instance. The latter can be constructed by urlRoute() function.
The pattern can be specified as a string, or as a RoutePattern instance. The latter can be constructed by urlRoutePattern() function.
import { matchMatrixRoute } from '@hatsy/route-match';
const match = matchMatrixRoute('root;length=5/long/path/to;dir=1/file.html;dir=0', 'root;length/**/*');
/*
match = {
$1: "long/path/to;dir=1/",
name: "file",
ext: "html",
}
*/
Matrix pattern recognizes matrix URLs.
Pattern format is the same as for URL Route with addition of attribute matchers:
;name requires matrix attribute to present.;name=value requires matrix attribute to have the given value.The path can be specified as a string, as URL, or as a MatrixRoute instance. The latter can be constructed by matrixRoute() function.
The pattern can be specified as a string, or as a RoutePattern instance. The latter can be constructed by matrixRoutePattern() function.
The library supports different route formats mentioned above. Each format represents the route as an array of entries plus additional info. The route can be constructed either manually or parsed by corresponding function.
All routes extend PathRoute interface with the following methods:
section(fromEntry[, toEntry]) returns a section of the route.toString() converts a route to original string, including search parameters and matrix attributes.toPathString() converts a route to path string, excluding search parameters and matrix attributes.A route pattern is an array of RouteMatchers compatible with corresponding route format. Route pattern can be
constructed out of rmatch... and rcapture... matchers, or parsed by corresponding function.
The routeMatch() function does the actual matching. It returns either null if the given path does not match
the pattern, or a RouteMatch instance. The latter is a function that reports captured matches when called.
FAQs
Route matching library
The npm package @hatsy/route-match receives a total of 42 weekly downloads. As such, @hatsy/route-match popularity was classified as not popular.
We found that @hatsy/route-match demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Five coordinated Chrome extensions enable session hijacking and block security controls across enterprise HR and ERP platforms.

Research
Node.js patched a crash bug where AsyncLocalStorage could cause stack overflows to bypass error handlers and terminate production servers.

Research
/Security News
A malicious Chrome extension steals newly created MEXC API keys, exfiltrates them to Telegram, and enables full account takeover with trading and withdrawal rights.