From d37bf330955646cc8c55f0363e8214cff070f0bb Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sun, 8 May 2022 10:57:16 -0500 Subject: [PATCH] Add isDarwin helper --- helpers/environment.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/helpers/environment.js b/helpers/environment.js index 782f41a..9910283 100644 --- a/helpers/environment.js +++ b/helpers/environment.js @@ -4,3 +4,12 @@ import has from 'just-has' export function isNuxt( VueThis ) { return has( VueThis, [ '$nuxt' ]) } + +// https://stackoverflow.com/a/8684009/1397641 +export function isDarwin () { + if ( typeof navigator !== 'undefined' ) return false + + if ( typeof process === 'undefined' ) return false + + return process.platform === 'darwin' +}