source: trip-planner-front/node_modules/regexp.prototype.flags/README.md@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 2.4 KB
Line 
1RegExp.prototype.flags <sup>[![Version Badge][npm-version-svg]][package-url]</sup>
2
3[![Build Status][travis-svg]][travis-url]
4[![dependency status][deps-svg]][deps-url]
5[![dev dependency status][dev-deps-svg]][dev-deps-url]
6[![License][license-image]][license-url]
7[![Downloads][downloads-image]][downloads-url]
8
9[![npm badge][npm-badge-png]][package-url]
10
11[![browser support][testling-svg]][testling-url]
12
13An ES6 spec-compliant `RegExp.prototype.flags` shim. Invoke its "shim" method to shim RegExp.prototype.flags if it is unavailable.
14*Note*: `RegExp#flags` requires a true ES5 environment - specifically, one with ES5 getters.
15
16This package implements the [es-shim API](https://github.com/es-shims/api) interface. It works in an ES5-supported environment and complies with the [spec](http://www.ecma-international.org/ecma-262/6.0/#sec-get-regexp.prototype.flags).
17
18Most common usage:
19```js
20var flags = require('regexp.prototype.flags');
21
22assert(flags(/a/) === '');
23assert(flags(new RegExp('a') === '');
24assert(flags(/a/mig) === 'gim');
25assert(flags(new RegExp('a', 'mig')) === 'gim');
26
27if (!RegExp.prototype.flags) {
28 flags.shim();
29}
30
31assert(flags(/a/) === /a/.flags);
32assert(flags(new RegExp('a') === new RegExp('a').flags);
33assert(flags(/a/mig) === /a/mig.flags);
34assert(flags(new RegExp('a', 'mig')) === new RegExp('a', 'mig').flags);
35```
36
37## Tests
38Simply clone the repo, `npm install`, and run `npm test`
39
40[package-url]: https://npmjs.com/package/regexp.prototype.flags
41[npm-version-svg]: http://versionbadg.es/es-shims/RegExp.prototype.flags.svg
42[travis-svg]: https://travis-ci.org/es-shims/RegExp.prototype.flags.svg
43[travis-url]: https://travis-ci.org/es-shims/RegExp.prototype.flags
44[deps-svg]: https://david-dm.org/es-shims/RegExp.prototype.flags.svg
45[deps-url]: https://david-dm.org/es-shims/RegExp.prototype.flags
46[dev-deps-svg]: https://david-dm.org/es-shims/RegExp.prototype.flags/dev-status.svg
47[dev-deps-url]: https://david-dm.org/es-shims/RegExp.prototype.flags#info=devDependencies
48[testling-svg]: https://ci.testling.com/es-shims/RegExp.prototype.flags.png
49[testling-url]: https://ci.testling.com/es-shims/RegExp.prototype.flags
50[npm-badge-png]: https://nodei.co/npm/regexp.prototype.flags.png?downloads=true&stars=true
51[license-image]: http://img.shields.io/npm/l/regexp.prototype.flags.svg
52[license-url]: LICENSE
53[downloads-image]: http://img.shields.io/npm/dm/regexp.prototype.flags.svg
54[downloads-url]: http://npm-stat.com/charts.html?package=regexp.prototype.flags
Note: See TracBrowser for help on using the repository browser.