source: imaps-frontend/node_modules/es-abstract/2023/IsRegExp.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 566 bytes
Line 
1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $match = GetIntrinsic('%Symbol.match%', true);
6
7var hasRegExpMatcher = require('is-regex');
8
9var ToBoolean = require('./ToBoolean');
10
11var isObject = require('../helpers/isObject');
12
13// https://262.ecma-international.org/6.0/#sec-isregexp
14
15module.exports = function IsRegExp(argument) {
16 if (!isObject(argument)) {
17 return false;
18 }
19 if ($match) {
20 var isRegExp = argument[$match];
21 if (typeof isRegExp !== 'undefined') {
22 return ToBoolean(isRegExp);
23 }
24 }
25 return hasRegExpMatcher(argument);
26};
Note: See TracBrowser for help on using the repository browser.