Coder Social home page Coder Social logo

es-shims / regexp.prototype.flags Goto Github PK

View Code? Open in Web Editor NEW
8.0 5.0 10.0 233 KB

ES6 spec-compliant RegExp.prototype.flags shim

Home Page: https://tc39.es/ecma262/#sec-get-regexp.prototype.flags

License: MIT License

JavaScript 100.00%
ecmascript flags javascript polyfill regex regexp regular-expression

regexp.prototype.flags's Introduction

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

regexp.prototype.flags's People

Contributors

ljharb avatar mathiasbynens avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

regexp.prototype.flags's Issues

es-abstract: callBindError

Hi ✋ ,

I'm using the npm module deep-equal which uses this package. After a recent npm i , I'm getting this error:

Error:

./node_modules/regexp.prototype.flags/index.js
Module not found: Error: Can't resolve 
    'es-abstract/helpers/callBind' in 
    '/home/jenkins/agent/workspace/ITG_Front-web/node_modules/regexp.prototype.flags'

which seems to be very related to this recent commit: c3a3727

Any ideas? I'm installing something wrong?

Ty in advance 🙏

An in-range update of es-abstract is breaking the build 🚨

The dependency es-abstract was updated from 1.17.0-next.1 to 1.17.0.

🚨 View failing branch.

This version is covered by your current version range and after updating it in your project the build failed.

es-abstract is a direct dependency of this project, and it is very likely causing it to break. If other packages depend on yours, this update is probably also breaking those in turn.

Status Details

Commits

The new version differs by 12 commits.

  • 91c2c22 v1.17.0
  • 96719b9 [Dev Deps] update @ljharb/eslint-config
  • c52fa59 [Fix] GetIntrinsic: IE 8 has a broken Object.getOwnPropertyDescriptor
  • fb308ec [Deps] update is-callable, string.prototype.trimleft, string.prototype.trimright
  • b84552d [Dev Deps] update tape
  • 9be0385 [Refactor] GetIntrinsic: further simplification
  • 0c7f99a [Tests] add .eslintignore
  • e2df4de [Dev Deps] update object-is
  • 158ed34 [Deps] update is-regex
  • 3567ae9 [Refactor] GetIntrinsic: remove the internal property salts, since % already handles that
  • 84c50fb [Dev Deps] update object.fromentries
  • f0b1083 [meta] remove unused Makefile and associated utils

See the full diff

FAQ and help

There is a collection of frequently asked questions. If those don’t help, you can always ask the humans behind Greenkeeper.


Your Greenkeeper Bot 🌴

Error: Cannot find module 'functions-have-names' -v1.5.1

failed to load config from /app/vite.config.ts
error during build:
Error: Cannot find module 'functions-have-names'
Require stack:

  • /app/node_modules/set-function-name/index.js
  • /app/node_modules/regexp.prototype.flags/implementation.js
  • /app/node_modules/regexp.prototype.flags/index.js
  • /app/node_modules/deep-equal/index.js
  • /app/node_modules/vite-plugin-pages/dist/index.js
  • /app/vite.config.ts
  • /app/node_modules/vite/dist/node/chunks/dep-ca21228b.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object. (/app/node_modules/set-function-name/index.js:5:38)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Object._require.extensions. [as .js] (file:///app/node_modules/vite/dist/node/chunks/dep-ca21228b.js:62359:17)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    Build step 'Execute shell' marked build as failure

Follow the spec

var str = String(this);
return str.slice(str.lastIndexOf('/') + 1);
is not per spec.

Object.getOwnPropertyDescriptor(RegExp.prototype, 'flags').get.call({ global: 0, sticky: 1, unicode: 1 })
// expected: 'uy'
// actual: '[object Object]'

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on Greenkeeper branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because it uses your CI build statuses to figure out when to notify you about breaking changes.

Since we didn’t receive a CI status on the greenkeeper/initial branch, it’s possible that you don’t have CI set up yet.
We recommend using:

If you have already set up a CI for this repository, you might need to check how it’s configured. Make sure it is set to run on all new branches. If you don’t want it to run on absolutely every branch, you can whitelist branches starting with greenkeeper/.

Once you have installed and configured CI on this repository correctly, you’ll need to re-trigger Greenkeeper’s initial pull request. To do this, please click the 'fix repo' button on account.greenkeeper.io.

Versioning issue

Hi,
When I try to install regexp.prototype.flags@^1.4.1 then it fails with the message "No matching version found for regexp.prototype.flags@^1.4.1"

Later when I checked npm info regexp.prototype.flags then it shows dist-tags: latest: 1.3.1 and it doesn't shows your later version 1.4.3.

Actually one of my project dependency is using npm package "es-abstract" and in version "1.20.0" it started using "regexp.prototype.flags": "^1.4.1" (new addition in es-abstract package.json). Due to this during rpm install is failing with following error

npm ERR! code ETARGET
npm ERR! notarget No matching version found for regexp.prototype.flags@^1.4.1
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! notarget
npm ERR! notarget It was specified as a dependency of 'es-abstract'
npm ERR! notarget

Not sure if it is something which I can fix at my end or if you need to do something at your end. Please help.

Regards,
Binay K

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Pending Approval

These branches will be created by Renovate only once you click their checkbox below.

  • [Deps] Update Update eslint to v8.57.0
  • [Deps] Update Update nyc to v15
  • 🔐 Create all pending approval PRs at once 🔐

Detected dependencies

github-actions
.github/workflows/node-aught.yml
.github/workflows/node-pretest.yml
.github/workflows/node-tens.yml
.github/workflows/rebase.yml
.github/workflows/require-allow-edits.yml
npm
package.json
  • call-bind ^1.0.7
  • define-properties ^1.2.1
  • es-errors ^1.3.0
  • set-function-name ^2.0.2
  • @es-shims/api ^2.4.2
  • @ljharb/eslint-config ^21.1.0
  • aud ^2.0.4
  • auto-changelog ^2.4.0
  • available-regexp-flags ^1.0.4
  • eclint ^2.8.1
  • es-value-fixtures ^1.4.2
  • eslint =8.8.0
  • for-each ^0.3.3
  • functions-have-names ^1.2.3
  • has-strict-mode ^1.0.1
  • hasown ^2.0.1
  • in-publish ^2.0.1
  • npmignore ^0.3.1
  • nyc ^10.3.2
  • object-inspect ^1.13.1
  • safe-publish-latest ^2.0.0
  • tape ^5.7.5
  • node >= 0.4

  • Check this box to trigger a request for Renovate to run again on this repository

Version 1.4.3 giving error : Unable to get property 'configurable' of undefined or null reference

Suddenly all our CI builds are failing from April 14. Comparing the node modules versions we found that this Package is updated to a new version and the faulty code is pointing to this NPM package.

Below is the Error we are getting while running our project. It's working fine on version 1.4.2 but not on 1.4.3

Error caught from window.onerror: Message: Unable to get property 'configurable' of undefined or null reference - URL: ms-appx

This Package is a dependency NPM package of npm module @ionic/[email protected] , so we are looking for a permanent fix for this.

Please help here on this fix ASAP.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.