PHP 8.1.33
Preview: index.js Size: 918 B
//lib/node_modules/npm/node_modules/is-regex/index.js

'use strict';

var has = require('has');
var regexExec = RegExp.prototype.exec;
var gOPD = Object.getOwnPropertyDescriptor;

var tryRegexExecCall = function tryRegexExec(value) {
	try {
		var lastIndex = value.lastIndex;
		value.lastIndex = 0;

		regexExec.call(value);
		return true;
	} catch (e) {
		return false;
	} finally {
		value.lastIndex = lastIndex;
	}
};
var toStr = Object.prototype.toString;
var regexClass = '[object RegExp]';
var hasToStringTag = typeof Symbol === 'function' && typeof Symbol.toStringTag === 'symbol';

module.exports = function isRegex(value) {
	if (!value || typeof value !== 'object') {
		return false;
	}
	if (!hasToStringTag) {
		return toStr.call(value) === regexClass;
	}

	var descriptor = gOPD(value, 'lastIndex');
	var hasLastIndexDataProperty = descriptor && has(descriptor, 'value');
	if (!hasLastIndexDataProperty) {
		return false;
	}

	return tryRegexExecCall(value);
};

Directory Contents

Dirs: 0 × Files: 10

Name Size Perms Modified Actions
4.04 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
97 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
4.66 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.08 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
918 B lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.06 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
3.74 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.79 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.59 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download
1.76 KB lrw-r--r-- 2021-03-10 14:36:37
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).