mirror of
https://github.com/actions/labeler
synced 2026-09-23 22:27:02 +02:00
build
This commit is contained in:
-8
@@ -1,8 +0,0 @@
|
||||
export function getUserAgent() {
|
||||
try {
|
||||
return navigator.userAgent;
|
||||
}
|
||||
catch (e) {
|
||||
return "<environment undetectable>";
|
||||
}
|
||||
}
|
||||
+9
-1
@@ -1 +1,9 @@
|
||||
export { getUserAgent } from "./node";
|
||||
export function getUserAgent() {
|
||||
if (typeof navigator === "object" && "userAgent" in navigator) {
|
||||
return navigator.userAgent;
|
||||
}
|
||||
if (typeof process === "object" && "version" in process) {
|
||||
return `Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`;
|
||||
}
|
||||
return "<environment undetectable>";
|
||||
}
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
import osName from "os-name";
|
||||
export function getUserAgent() {
|
||||
try {
|
||||
return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
|
||||
}
|
||||
catch (error) {
|
||||
if (/wmic os get Caption/.test(error.message)) {
|
||||
return "Windows <version undetectable>";
|
||||
}
|
||||
return "<environment undetectable>";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user