run test and fix one test

This commit is contained in:
Harlan Brawer 2025-07-28 15:42:13 -07:00
parent 672fa063e5
commit fb91647c20
10 changed files with 26 additions and 18 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -179,6 +179,7 @@ const BrowserType = Object.freeze({
const CPU = Object.freeze({ const CPU = Object.freeze({
'68K': '68k', '68K': '68k',
ALPHA: 'alpha',
ARM : 'arm', ARM : 'arm',
ARM_64: 'arm64', ARM_64: 'arm64',
ARM_HF: 'armhf', ARM_HF: 'armhf',

View File

@ -48,6 +48,8 @@ const Crawlers = Object.freeze({
// Amazonbot - https://developer.amazon.com/amazonbot // Amazonbot - https://developer.amazon.com/amazonbot
// Bingbot / AdIdxBot - https://www.bing.com/webmasters/help/which-crawlers-does-bing-use-8c184ec0 // Bingbot / AdIdxBot - https://www.bing.com/webmasters/help/which-crawlers-does-bing-use-8c184ec0
// CCBot - https://commoncrawl.org/faq // CCBot - https://commoncrawl.org/faq
// Coveobot - https://connect.coveo.com/s/article/19648
// CriteoBot - https://www.criteo.com/criteo-crawler/
// Dotbot - https://moz.com/help/moz-procedures/crawlers/dotbot // Dotbot - https://moz.com/help/moz-procedures/crawlers/dotbot
// DuckDuckBot - http://duckduckgo.com/duckduckbot.html // DuckDuckBot - http://duckduckgo.com/duckduckbot.html
// FacebookBot - https://developers.facebook.com/docs/sharing/bot/ // FacebookBot - https://developers.facebook.com/docs/sharing/bot/
@ -60,7 +62,7 @@ const Crawlers = Object.freeze({
// OpenAI's SearchGPT - https://platform.openai.com/docs/bots // OpenAI's SearchGPT - https://platform.openai.com/docs/bots
// PerplexityBot - https://perplexity.ai/perplexitybot // PerplexityBot - https://perplexity.ai/perplexitybot
// SeznamBot - http://napoveda.seznam.cz/seznambot-intro // SeznamBot - http://napoveda.seznam.cz/seznambot-intro
/((?:adidx|ahrefs|amazon|bing|cc|dot|duckduck|exa|facebook|gpt|iask|linkedin|mj12|mojeek|oai-search|onespot-scraper|perplexity|semrush|seznam)bot)\/([\w\.-]+)/i, /((?:adidx|ahrefs|amazon|bing|cc|coveo|criteo|dot|duckduck|exa|facebook|gpt|iask|linkedin|mj12|mojeek|oai-search|onespot-scraper|perplexity|semrush|seznam)bot)\/([\w\.-]+)/i,
// Applebot - http://apple.com/go/applebot // Applebot - http://apple.com/go/applebot
/(applebot(?:-extended)?)\/?([\w\.]*)/i, /(applebot(?:-extended)?)\/?([\w\.]*)/i,
@ -69,7 +71,7 @@ const Crawlers = Object.freeze({
/(baiduspider[-imagevdonwsfcpr]{0,7})\/?([\w\.]*)/i, /(baiduspider[-imagevdonwsfcpr]{0,7})\/?([\w\.]*)/i,
// ClaudeBot (Anthropic) // ClaudeBot (Anthropic)
/(claude(?:bot|-web)|anthropic-ai)\/?([\w\.]*)/i, /(claude(?:bot|-searchbot|-web)|anthropic-ai)\/?([\w\.]*)/i,
// Coc Coc Bot - https://help.coccoc.com/en/search-engine // Coc Coc Bot - https://help.coccoc.com/en/search-engine
/(coccocbot-(?:image|web))\/([\w\.]+)/i, /(coccocbot-(?:image|web))\/([\w\.]+)/i,
@ -239,15 +241,16 @@ const Fetchers = Object.freeze({
browser : [ browser : [
[ [
// AhrefsSiteAudit - https://ahrefs.com/robot/site-audit // AhrefsSiteAudit - https://ahrefs.com/robot/site-audit
// Buffer Link Preview Bot - https://scraper.buffer.com/about/bots/link-preview-bot
// ChatGPT-User - https://platform.openai.com/docs/plugins/bot // ChatGPT-User - https://platform.openai.com/docs/plugins/bot
// DuckAssistBot - https://duckduckgo.com/duckassistbot/ // DuckAssistBot - https://duckduckgo.com/duckassistbot/
// Better Uptime / BingPreview / Mastodon / MicrosoftPreview / Pinterestbot / Redditbot / Rogerbot / SiteAuditBot / Telegrambot / Twitterbot / UptimeRobot // Better Uptime / BingPreview / Blueno / Mastodon / MicrosoftPreview / Pinterestbot / Redditbot / Rogerbot / SiteAuditBot / Telegrambot / Twitterbot / UptimeRobot
// Google Site Verifier / Meta / Yahoo! Japan // Google Site Verifier / Meta / Yahoo! Japan
// Iframely - https://iframely.com/docs/about // Iframely - https://iframely.com/docs/about
// Perplexity-User - https://docs.perplexity.ai/guides/bots // Perplexity-User - https://docs.perplexity.ai/guides/bots
// MistralAI-User - https://docs.mistral.ai/robots/ // MistralAI-User - https://docs.mistral.ai/robots/
// Yandex Bots - https://yandex.com/bots // Yandex Bots - https://yandex.com/bots
/(ahrefssiteaudit|(?:bing|microsoft)preview|(?:chatgpt|mistralai|perplexity)-user|mastodon|(?:discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptimero)bot|google-site-verification|iframely|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|searchshop)|yadirectfetcher)\/([\w\.]+)/i, /(ahrefssiteaudit|(?:bing|microsoft)preview|blueno|(?:chatgpt|claude|mistralai|perplexity)-user|mastodon|(?:bufferlinkpreview|discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptimero)bot|google-site-verification|iframely|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|searchshop)|yadirectfetcher)\/([\w\.]+)/i,
// Bluesky // Bluesky
/(bluesky) cardyb\/([\w\.]+)/i, /(bluesky) cardyb\/([\w\.]+)/i,
@ -408,8 +411,8 @@ const Vehicles = Object.freeze({
const Bots = Object.freeze({ const Bots = Object.freeze({
browser : [ browser : [
...CLIs.browser, ...CLIs.browser,
...Crawlers.browser,
...Fetchers.browser, ...Fetchers.browser,
...Crawlers.browser,
...Libraries.browser ...Libraries.browser
], ],
os : [ os : [

View File

@ -56,6 +56,7 @@ const isAIBot = (resultOrUA) => [
// Anthropic // Anthropic
'anthropic-ai', 'anthropic-ai',
'claude-web', 'claude-web',
'claude-searchbot',
'claudebot', 'claudebot',
// Apple // Apple
@ -67,6 +68,9 @@ const isAIBot = (resultOrUA) => [
// Common Crawl // Common Crawl
'ccbot', 'ccbot',
// Coveo
'coveobot',
// DataForSeo // DataForSeo
'dataforseobot', 'dataforseobot',

View File

@ -3,7 +3,7 @@
// Definitions by: Faisal Salman <https://github.com/faisalman> // Definitions by: Faisal Salman <https://github.com/faisalman>
import type { Headers as FetchAPIHeaders } from "undici"; import type { Headers as FetchAPIHeaders } from "undici";
import { IncomingHttpHeaders } from "undici/types/header"; import type { IncomingHttpHeaders } from "undici/types/header";
declare namespace UAParser { declare namespace UAParser {

View File

@ -538,15 +538,15 @@
/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i /( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i
], [[ARCHITECTURE, 'arm']], [ ], [[ARCHITECTURE, 'arm']], [
/((ppc|powerpc)(64)?)( mac|;|\))/i // PowerPC
], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [
/ sun4\w[;\)]/i // SPARC / sun4\w[;\)]/i // SPARC
], [[ARCHITECTURE, 'sparc']], [ ], [[ARCHITECTURE, 'sparc']], [
/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i
// IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC // IA64, 68K, ARM/64, AVR/32, IRIX/64, MIPS/64, SPARC/64, PA-RISC
], [[ARCHITECTURE, lowerize]] /\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,
/((ppc|powerpc)(64)?)( mac|;|\))/i, // PowerPC
/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i // Alpha
], [[ARCHITECTURE, /ower/, EMPTY, lowerize]], [
/winnt.+\[axp/i
], [[ARCHITECTURE, 'alpha']]
], ],
device : [[ device : [[
@ -885,7 +885,7 @@
/droid.+; (glass) \d/i // Google Glass /droid.+; (glass) \d/i // Google Glass
], [MODEL, [VENDOR, GOOGLE], [TYPE, XR]], [ ], [MODEL, [VENDOR, GOOGLE], [TYPE, XR]], [
/(pico) (4|neo3(?: link|pro)?)/i // Pico /(pico) ([\w ]+) os\d/i // Pico
], [VENDOR, MODEL, [TYPE, XR]], [ ], [VENDOR, MODEL, [TYPE, XR]], [
/(quest( \d| pro)?s?).+vr/i // Meta Quest /(quest( \d| pro)?s?).+vr/i // Meta Quest
], [MODEL, [VENDOR, FACEBOOK], [TYPE, XR]], [ ], [MODEL, [VENDOR, FACEBOOK], [TYPE, XR]], [

View File

@ -10,7 +10,7 @@ var cpus = require('../data/ua/cpu/cpu-all.json');
var devices = readJsonFiles('test/data/ua/device'); var devices = readJsonFiles('test/data/ua/device');
var engines = require('../data/ua/engine/engine-all.json'); var engines = require('../data/ua/engine/engine-all.json');
var os = readJsonFiles('test/data/ua/os'); var os = readJsonFiles('test/data/ua/os');
var { Headers } = require('node-fetch'); var { Headers } = require('undici');
function readJsonFiles(dir) { function readJsonFiles(dir) {
var list = []; var list = [];