/**
 * Copyright (c) 2020, 2021 Oracle and/or its affiliates.  All rights reserved.
 * This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.

 * Utility method to check if environment is node or browser
 */ import CircuitBreaker from "./circuit-breaker" ; import { ClientConfiguration } from "./client-configuration" ; export function isBrowser ( ) { if ( typeof window === "undefined" ) { return false ; } return true ; } export function isEmpty ( obj ) { return Object . keys ( obj ) . length === 0 ; } export function checkNotNull ( value , msg ) { if ( value ) { return value ; } throw new Error ( msg ) ; } export function isCircuitBreakerSystemEnabled ( clientConfiguration ) { const clientLevelCheck = clientConfiguration && clientConfiguration . circuitBreaker && clientConfiguration . circuitBreaker . noCircuit ; if ( clientLevelCheck || ! CircuitBreaker . EnableGlobalCircuitBreaker || CircuitBreaker . EnableDefaultCircuitBreaker === "false" ) { return false ; } return true ; }