How to use the @bugsnag/core/lib/es-utils.isArray function in @bugsnag/core

To help you get started, we’ve selected a few @bugsnag/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bugsnag / bugsnag-js / packages / plugin-server-session / session.js View on Github external
const sendSessionSummary = client => sessionCounts => {
  const releaseStage = inferReleaseStage(client)

  // exit early if the reports should not be sent on the current releaseStage
  if (isArray(client.config.notifyReleaseStages) && !includes(client.config.notifyReleaseStages, releaseStage)) {
    client._logger.warn(`Session not sent due to releaseStage/notifyReleaseStages configuration`)
    return
  }

  if (!client.config.endpoints.sessions) {
    client._logger.warn(`Session not sent due to missing endpoints.sessions configuration`)
    return
  }

  if (!sessionCounts.length) return

  const backoff = new Backoff({ min: 1000, max: 10000 })
  const maxAttempts = 10
  req(handleRes)

  function handleRes (err) {
github bugsnag / bugsnag-js / packages / plugin-browser-session / session.js View on Github external
startSession: client => {
    const sessionClient = client
    sessionClient._session = new client.BugsnagSession()

    const releaseStage = inferReleaseStage(sessionClient)

    // exit early if the reports should not be sent on the current releaseStage
    if (isArray(sessionClient.config.notifyReleaseStages) && !includes(sessionClient.config.notifyReleaseStages, releaseStage)) {
      sessionClient._logger.warn(`Session not sent due to releaseStage/notifyReleaseStages configuration`)
      return sessionClient
    }

    if (!sessionClient.config.endpoints.sessions) {
      sessionClient._logger.warn(`Session not sent due to missing endpoints.sessions configuration`)
      return sessionClient
    }

    sessionClient._delivery.sendSession({
      notifier: sessionClient.notifier,
      device: sessionClient.device,
      app: { ...{ releaseStage }, ...sessionClient.app },
      sessions: [
        {
          id: sessionClient._session.id,