Security News
How Threat Actors are Abusing GitHub’s File Upload Feature to Host Malware
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
regexp.prototype.flags
Advanced tools
Changelog
v1.5.2 - 2024-02-11
c692c88
hasown
instead of has
fb5b350
aud
, hasown
, npmignore
, tape
fd0ddd9
call-bind
, define-properties
, set-function-name
ca53f66
object-inspect
, tape
4491680
es-errors
1d03d22
024d442
call-bind
f222ce0
Readme
An ES6 spec-compliant RegExp.prototype.flags
shim. Invoke its "shim" method to shim RegExp.prototype.flags if it is unavailable.
Note: RegExp#flags
requires a true ES5 environment - specifically, one with ES5 getters.
This package implements the es-shim API interface. It works in an ES5-supported environment and complies with the spec.
Most common usage:
var flags = require('regexp.prototype.flags');
assert(flags(/a/) === '');
assert(flags(new RegExp('a') === '');
assert(flags(/a/mig) === 'gim');
assert(flags(new RegExp('a', 'mig')) === 'gim');
if (!RegExp.prototype.flags) {
flags.shim();
}
assert(flags(/a/) === /a/.flags);
assert(flags(new RegExp('a') === new RegExp('a').flags);
assert(flags(/a/mig) === /a/mig.flags);
assert(flags(new RegExp('a', 'mig')) === new RegExp('a', 'mig').flags);
Simply clone the repo, npm install
, and run npm test
FAQs
ES6 spec-compliant RegExp.prototype.flags shim.
The npm package regexp.prototype.flags receives a total of 27,999,212 weekly downloads. As such, regexp.prototype.flags popularity was classified as popular.
We found that regexp.prototype.flags demonstrated a healthy version release cadence and project activity because the last version was released less than 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
GitHub is susceptible to a CDN flaw that allows attackers to host malware on any public repository.
Security News
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.