Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
54
node_modules/next/dist/shared/lib/router/utils/is-bot.js
generated
vendored
Normal file
54
node_modules/next/dist/shared/lib/router/utils/is-bot.js
generated
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
HTML_LIMITED_BOT_UA_RE: null,
|
||||
HTML_LIMITED_BOT_UA_RE_STRING: null,
|
||||
getBotType: null,
|
||||
isBot: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
HTML_LIMITED_BOT_UA_RE: function() {
|
||||
return _htmlbots.HTML_LIMITED_BOT_UA_RE;
|
||||
},
|
||||
HTML_LIMITED_BOT_UA_RE_STRING: function() {
|
||||
return HTML_LIMITED_BOT_UA_RE_STRING;
|
||||
},
|
||||
getBotType: function() {
|
||||
return getBotType;
|
||||
},
|
||||
isBot: function() {
|
||||
return isBot;
|
||||
}
|
||||
});
|
||||
const _htmlbots = require("./html-bots");
|
||||
// Bot crawler that will spin up a headless browser and execute JS
|
||||
const HEADLESS_BROWSER_BOT_UA_RE = /Googlebot|Google-PageRenderer|AdsBot-Google|googleweblight|Storebot-Google/i;
|
||||
const HTML_LIMITED_BOT_UA_RE_STRING = _htmlbots.HTML_LIMITED_BOT_UA_RE.source;
|
||||
function isDomBotUA(userAgent) {
|
||||
return HEADLESS_BROWSER_BOT_UA_RE.test(userAgent);
|
||||
}
|
||||
function isHtmlLimitedBotUA(userAgent) {
|
||||
return _htmlbots.HTML_LIMITED_BOT_UA_RE.test(userAgent);
|
||||
}
|
||||
function isBot(userAgent) {
|
||||
return isDomBotUA(userAgent) || isHtmlLimitedBotUA(userAgent);
|
||||
}
|
||||
function getBotType(userAgent) {
|
||||
if (isDomBotUA(userAgent)) {
|
||||
return 'dom';
|
||||
}
|
||||
if (isHtmlLimitedBotUA(userAgent)) {
|
||||
return 'html';
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=is-bot.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue