Socket
Socket
Sign inDemoInstall

regexp.prototype.flags

Package Overview
Dependencies
14
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    regexp.prototype.flags

ES6 spec-compliant RegExp.prototype.flags shim.


Version published
Weekly downloads
34M
decreased by-1.21%
Maintainers
1
Install size
234 kB
Created
Weekly downloads
 

Changelog

Source

v1.3.1 - 2021-01-15

Commits

  • [Tests] run nyc on all tests; use tape runner; add full es-shims test suite 047a1e8
  • [Tests] migrate tests to Github Actions e4e391f
  • [meta] use auto-changelog for changelog afbcd06
  • [actions] add Require Allow Edits workflow 0db5d50
  • [meta] do not publish github action workflow files 53f2902
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape; add aud 05f2a85
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, tape 2a197b8
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape; add safe-publish-latest e40bd37
  • [Refactor] use call-bind instead of es-abstract e6eac90
  • [Deps] update es-abstract f198075
  • [actions] switch Automatic Rebase workflow to pull_request_target event 2d21727
  • [Deps] update es-abstract 7e7ddc6

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

Last updated on 15 Jan 2021

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc