[submodule:extensions] Breaking change: rename module to library

This commit is contained in:
Faisal Salman
2024-11-10 08:15:39 +07:00
parent 19e5d322e2
commit 3b3361fe53
8 changed files with 23 additions and 23 deletions

View File

@@ -159,7 +159,7 @@ const BrowserType = Object.freeze({
FETCHER: 'fetcher',
INAPP: 'inapp',
MEDIAPLAYER: 'mediaplayer',
MODULE: 'module'
LIBRARY: 'library'
});
const CPU = Object.freeze({

View File

@@ -11,5 +11,5 @@ export const ExtraDevices: UAParserExt;
export const Emails: UAParserExt;
export const Fetchers: UAParserExt;
export const InApps: UAParserExt;
export const MediaPlayers: UAParserExt;
export const Modules: UAParserExt;
export const Libraries: UAParserExt;
export const MediaPlayers: UAParserExt;

View File

@@ -20,7 +20,7 @@ const EMAIL = 'email';
const FETCHER = 'fetcher';
const INAPP = 'inapp';
const MEDIAPLAYER = 'mediaplayer';
const MODULE = 'module';
const LIBRARY = 'library';
//////////////////////
// COMMAND LINE APPS
@@ -332,14 +332,14 @@ const MediaPlayers = Object.freeze({
]
});
////////////////////////
// MODULES / LIBRARIES
///////////////////////
/////////////
// LIBRARIES
//////////////
const Modules = Object.freeze({
const Libraries = Object.freeze({
browser : [
// Axios/jsdom/Scrapy
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, MODULE]]
[/\b(axios|jsdom|scrapy)\/([\w\.]+)/i], [NAME, VERSION, [TYPE, LIBRARY]]
]
});
@@ -352,7 +352,7 @@ const Bots = Object.freeze({
...CLIs.browser,
...Crawlers.browser,
...Fetchers.browser,
...Modules.browser
...Libraries.browser
]
});
@@ -364,6 +364,6 @@ module.exports = {
Emails,
Fetchers,
InApps,
MediaPlayers,
Modules
Libraries,
MediaPlayers
};

View File

@@ -37,7 +37,7 @@ const isAppleSilicon = (res, useFeatureDetection) => {
return false;
}
const isBot = (res) => ['cli', 'crawler', 'fetcher', 'module'].includes(res.browser.type);
const isBot = (res) => ['cli', 'crawler', 'fetcher', 'library'].includes(res.browser.type);
const isChromeFamily = (res) => res.engine.is(Engine.BLINK);

View File

@@ -15,7 +15,7 @@ declare namespace UAParser {
name?: string;
version?: string;
major?: string;
type?: 'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | 'module';
type?: 'crawler' | 'cli' | 'email' | 'fetcher' | 'inapp' | 'mediaplayer' | 'library';
}
interface ICPU extends IData<ICPU> {