Skip to content

vue-qs v0.1.18


vue-qs / isBrowserEnvironment

Function: isBrowserEnvironment()

isBrowserEnvironment(): boolean

Defined in: utils/core-helpers.ts:14

Safely checks if we're running in a browser environment

Returns

boolean

true if running in a browser, false otherwise

Example

ts
if (isBrowserEnvironment()) {
  // Safe to use window, document, etc.
  console.log(window.location.href);
}

Released under the MIT License.