
Research
Malicious npm Package Brand-Squats TanStack to Exfiltrate Environment Variables
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.
clone-regexp
Advanced tools
Clone and modify a RegExp instance
$ npm install clone-regexp
import cloneRegexp from 'clone-regexp';
const regex = /[a-z]/gi;
cloneRegexp(regex);
//=> /[a-z]/gi
cloneRegexp(regex) === regex;
//=> false
cloneRegexp(regex, {global: false});
//=> /[a-z]/i
cloneRegexp(regex, {multiline: true});
//=> /[a-z]/gim
cloneRegexp(regex, {source: 'unicorn'});
//=> /unicorn/gi
Type: RegExp
Regex to clone.
Type: object
Properties: source global ignoreCase multiline dotAll sticky unicode lastIndex
Optionally modify the cloned RegExp instance.
The regexp-clone package provides similar functionality to clone-regexp by allowing users to clone regular expressions. It preserves the source, flags, and lastIndex of the original regex. The main difference is in the implementation and possibly in the specific features or options provided by each package.
The clone package is a more general utility for cloning objects, arrays, dates, and regular expressions in JavaScript. While it can clone regular expressions like clone-regexp, it is not specialized for regex cloning and does not provide options to modify the cloned regex's properties.
FAQs
Clone and modify a RegExp instance
The npm package clone-regexp receives a total of 1,670,294 weekly downloads. As such, clone-regexp popularity was classified as popular.
We found that clone-regexp 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
A brand-squatted TanStack npm package used postinstall scripts to steal .env files and exfiltrate developer secrets to an attacker-controlled endpoint.

Research
Compromised SAP CAP npm packages download and execute unverified binaries, creating urgent supply chain risk for affected developers and CI/CD environments.

Company News
Socket has acquired Secure Annex to expand extension security across browsers, IDEs, and AI tools.