mirror of
https://github.com/actions/setup-python.git
synced 2025-06-28 21:53:47 +00:00
Clean up node_modules
This commit is contained in:
parent
b581dd4017
commit
145e800d1f
7184 changed files with 11271 additions and 1877650 deletions
39
node_modules/is-regex/index.js
generated
vendored
39
node_modules/is-regex/index.js
generated
vendored
|
@ -1,39 +0,0 @@
|
|||
'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);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue