Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
A chai assertion plugin for working with urls
Provides a number of assertion helpers for working with urls.
const chai = require('chai');
chai.use(require('chai-url'));
chai.expect('http://example.com/foo/bar').to.have.path('/foo/bar');
chai.expect('http://example.com/foo/bar').to.have.protocol('http');
path
pathname
port
hostname
protocol
auth
hash
In each case, the property is tested against the corresponding property from node's url.parse method.
In the case of hash
and protocol
properties which may be prefixed/suffixed with #
and :
respectively these characters are optional and will match with or without their presence.
The path
, pathname
, hostname
, auth
and hash
functions can also perform partial matching based on substrings by using a contains
clause in the test statement.
expect('http://example.com/foo/bar').to.contain.path('/foo');
See the tests for this module for further examples.
FAQs
A chai assertion plugin for working with urls
We found that chai-url 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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.