Initial boiler plate project
This commit is contained in:
46
node_modules/next/dist/server/web/spec-extension/user-agent.js
generated
vendored
Normal file
46
node_modules/next/dist/server/web/spec-extension/user-agent.js
generated
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
0 && (module.exports = {
|
||||
isBot: null,
|
||||
userAgent: null,
|
||||
userAgentFromString: null
|
||||
});
|
||||
function _export(target, all) {
|
||||
for(var name in all)Object.defineProperty(target, name, {
|
||||
enumerable: true,
|
||||
get: all[name]
|
||||
});
|
||||
}
|
||||
_export(exports, {
|
||||
isBot: function() {
|
||||
return isBot;
|
||||
},
|
||||
userAgent: function() {
|
||||
return userAgent;
|
||||
},
|
||||
userAgentFromString: function() {
|
||||
return userAgentFromString;
|
||||
}
|
||||
});
|
||||
const _uaparserjs = /*#__PURE__*/ _interop_require_default(require("next/dist/compiled/ua-parser-js"));
|
||||
function _interop_require_default(obj) {
|
||||
return obj && obj.__esModule ? obj : {
|
||||
default: obj
|
||||
};
|
||||
}
|
||||
function isBot(input) {
|
||||
return /Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Google-InspectionTool|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(input);
|
||||
}
|
||||
function userAgentFromString(input) {
|
||||
return {
|
||||
...(0, _uaparserjs.default)(input),
|
||||
isBot: input === undefined ? false : isBot(input)
|
||||
};
|
||||
}
|
||||
function userAgent({ headers }) {
|
||||
return userAgentFromString(headers.get("user-agent") || undefined);
|
||||
}
|
||||
|
||||
//# sourceMappingURL=user-agent.js.map
|
||||
Reference in New Issue
Block a user