MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / getOS

Function getOS

packages/ui/src/utils/genericHelper.js:1013–1033  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1011}
1012
1013export const getOS = () => {
1014 let userAgent = window.navigator.userAgent.toLowerCase(),
1015 macosPlatforms = /(macintosh|macintel|macppc|mac68k|macos)/i,
1016 windowsPlatforms = /(win32|win64|windows|wince)/i,
1017 iosPlatforms = /(iphone|ipad|ipod)/i,
1018 os = null
1019
1020 if (macosPlatforms.test(userAgent)) {
1021 os = 'macos'
1022 } else if (iosPlatforms.test(userAgent)) {
1023 os = 'ios'
1024 } else if (windowsPlatforms.test(userAgent)) {
1025 os = 'windows'
1026 } else if (/android/.test(userAgent)) {
1027 os = 'android'
1028 } else if (!os && /linux/.test(userAgent)) {
1029 os = 'linux'
1030 }
1031
1032 return os
1033}
1034
1035export const formatBytes = (number) => {
1036 if (number == null || number === undefined || number <= 0) {

Callers 2

ViewHeader.jsxFile · 0.90

Calls 1

testMethod · 0.80

Tested by

no test coverage detected