Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/local/lib/node_modules/babel-cli/node_modules/regex-cache/ drwxr-xr-x | |
| Viewing file: Select action/file-type: /*!
* regex-cache <https://github.com/jonschlinkert/regex-cache>
*
* Copyright (c) 2015-2017, Jon Schlinkert.
* Released under the MIT License.
*/
'use strict';
var equal = require('is-equal-shallow');
var basic = {};
var cache = {};
/**
* Expose `regexCache`
*/
module.exports = regexCache;
/**
* Memoize the results of a call to the new RegExp constructor.
*
* @param {Function} fn [description]
* @param {String} str [description]
* @param {Options} options [description]
* @param {Boolean} nocompare [description]
* @return {RegExp}
*/
function regexCache(fn, str, opts) {
var key = '_default_', regex, cached;
if (!str && !opts) {
if (typeof fn !== 'function') {
return fn;
}
return basic[key] || (basic[key] = fn(str));
}
var isString = typeof str === 'string';
if (isString) {
if (!opts) {
return basic[str] || (basic[str] = fn(str));
}
key = str;
} else {
opts = str;
}
cached = cache[key];
if (cached && equal(cached.opts, opts)) {
return cached.regex;
}
memo(key, opts, (regex = fn(str, opts)));
return regex;
}
function memo(key, opts, regex) {
cache[key] = {regex: regex, opts: opts};
}
/**
* Expose `cache`
*/
module.exports.cache = cache;
module.exports.basic = basic;
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0046 ]-- |