import * as App from '@flamelink/sdk-app-types' ; import { logError } from '@flamelink/sdk-utils' ; import get from 'lodash/get' ; export const getModule = ( moduleName , context ) => { if ( context . modules [ moduleName ] ) { return context . modules [ moduleName ] ; } return context . proxySupported ? new Proxy ( { } , { get ( obj , prop ) { return ( ) => logError ( `Oh no! Looks like you have not imported the "${ moduleName }" module.` ) ; } , } ) : null ; } ; description param context returns { Void } export const ensureValidContext = ( context ) => { if ( ! context . firebaseApp ) { throw new Error ( '[FLAMELINK]: Please provide a "firebaseApp" Firebase app instance when initializing your Flamelink app' ) ; } } ; description param firebaseApp returns { Boolean } export const isAdminApp = ( firebaseApp ) : boolean => { return ( ! ! get ( firebaseApp , 'options.credential' ) && ! get ( firebaseApp , 'options.apiKey' ) ) ; } ; description returns { Boolean } export const isNodeEnvironment = ( ) : boolean => { let isNode = false ; try { isNode = Object . prototype . toString . call ( global . process ) === '[object process]' ; } catch ( e ) { } return isNode ; } ;