Big update!Announcing Socket for GitHub 1.0. Learn more
Socket
BlogLoveFAQ
Install
Log in

regexp.prototype.flags

Package Overview
Dependencies
3
Maintainers
1
Versions
12
Issues
File Explorer

Advanced tools

regexp.prototype.flags

ES6 spec-compliant RegExp.prototype.flags shim.

    1.4.3latest

Version published
Maintainers
1
Weekly downloads
24,301,626
increased by1.41%

Weekly downloads

Changelog

Source

v1.4.3 - 2022-04-14

Commits

  • [Fix] when shimmed, name must be get flags fcefd00

Readme

Source

RegExp.prototype.flags Version Badge

Build Status dependency status dev dependency status License Downloads

npm badge

browser support

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);

Tests

Simply clone the repo, npm install, and run npm test

Keywords

FAQs

What is regexp.prototype.flags?

ES6 spec-compliant RegExp.prototype.flags shim.

Is regexp.prototype.flags popular?

The npm package regexp.prototype.flags receives a total of 19,859,858 weekly downloads. As such, regexp.prototype.flags popularity was classified as popular.

Is regexp.prototype.flags well maintained?

We found that regexp.prototype.flags demonstrated a healthy version release cadence and project activity. It has 1 open source maintainer collaborating on the project.

Last updated on 15 Apr 2022
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc