node_modules/@google-cloud/firestore/build/src/index.js
/**
     * Initializes the client if it is not already initialized. All methods in the
     * SDK can be used after this method completes.
     *
     * @private
     * @param requestTag A unique client-assigned identifier that caused this
     * initialization.
     * @return A Promise that resolves when the client is initialized.
     */
Initializes the client if it is not already initialized. All methods in the
SDK can be used after this method completes.

@private
@param requestTag A unique client-assigned identifier that caused this
initialization.
@return A Promise that resolves when the client is initialized.
Initializes the client if it is not already initialized . All methods in the SDK can be used after this method completes . @private @param requestTag A unique client - assigned identifier that caused this initialization . @return A Promise that resolves when the client is initialized .
async initializeIfNeeded(requestTag) {
        this._settingsFrozen = true;
        if (this._settings.ssl === false) {
            this._settings.customHeaders = Object.assign({ Authorization: 'Bearer owner' }, this._settings.customHeaders);
        }
        if (this._projectId === undefined) {
            try {
                this._projectId = await this._clientPool.run(requestTag, gapicClient => gapicClient.getProjectId());
                logger_1.logger('Firestore.initializeIfNeeded', null, 'Detected project ID: %s', this._projectId);
            }
            catch (err) {
                logger_1.logger('Firestore.initializeIfNeeded', null, 'Failed to detect project ID: %s', err);
                return Promise.reject(err);
            }
        }
    }
async initializeIfNeeded ( requestTag ) { this . _settingsFrozen = true ; if ( this . _settings . ssl === false ) { this . _settings . customHeaders = Object . assign ( { Authorization : 'Bearer owner' } , this . _settings . customHeaders ) ; } if ( this . _projectId === undefined ) { try { this . _projectId = await this . _clientPool . run ( requestTag , gapicClient => gapicClient . getProjectId ( ) ) ; logger_1 . logger ( 'Firestore.initializeIfNeeded' , null , 'Detected project ID: %s' , this . _projectId ) ; } catch ( err ) { logger_1 . logger ( 'Firestore.initializeIfNeeded' , null , 'Failed to detect project ID: %s' , err ) ; return Promise . reject ( err ) ; } } }
Initializes the client if it is not already initialized.
Initializes the client if it is not already initialized .
// If SSL is false, we assume that we are talking to the emulator. We // provide an Authorization header by default so that the connection is // recognized as admin in Firestore Emulator. (If for some reason we're // not connecting to the emulator, then this will result in denials with // invalid token, rather than behave like clients not logged in. The user // can then provide their own Authorization header, which will take // precedence).