|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
570 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | var GetIntrinsic = require('get-intrinsic');
|
|---|
| 4 |
|
|---|
| 5 | var $match = GetIntrinsic('%Symbol.match%', true);
|
|---|
| 6 |
|
|---|
| 7 | var hasRegExpMatcher = require('is-regex');
|
|---|
| 8 | var isObject = require('es-object-atoms/isObject');
|
|---|
| 9 |
|
|---|
| 10 | var ToBoolean = require('./ToBoolean');
|
|---|
| 11 |
|
|---|
| 12 | // https://262.ecma-international.org/6.0/#sec-isregexp
|
|---|
| 13 |
|
|---|
| 14 | module.exports = function IsRegExp(argument) {
|
|---|
| 15 | if (!isObject(argument)) {
|
|---|
| 16 | return false;
|
|---|
| 17 | }
|
|---|
| 18 | if ($match) {
|
|---|
| 19 | var isRegExp = argument[$match];
|
|---|
| 20 | if (typeof isRegExp !== 'undefined') {
|
|---|
| 21 | return ToBoolean(isRegExp);
|
|---|
| 22 | }
|
|---|
| 23 | }
|
|---|
| 24 | return hasRegExpMatcher(argument);
|
|---|
| 25 | };
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.