MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: //home/cafsindia/snap.cafsinfotech.in/node_modules/@sentry/core/cjs/integrations/metadata.js
Object.defineProperty(exports, '__esModule', { value: true });

const utils = require('@sentry/utils');
const metadata = require('../metadata.js');

/**
 * Adds module metadata to stack frames.
 *
 * Metadata can be injected by the Sentry bundler plugins using the `_experiments.moduleMetadata` config option.
 *
 * When this integration is added, the metadata passed to the bundler plugin is added to the stack frames of all events
 * under the `module_metadata` property. This can be used to help in tagging or routing of events from different teams
 * our sources
 */
class ModuleMetadata  {
  /*
   * @inheritDoc
   */
   static __initStatic() {this.id = 'ModuleMetadata';}

  /**
   * @inheritDoc
   */

   constructor() {
    this.name = ModuleMetadata.id;
  }

  /**
   * @inheritDoc
   */
   setupOnce(addGlobalEventProcessor, getCurrentHub) {
    const client = getCurrentHub().getClient();

    if (!client || typeof client.on !== 'function') {
      return;
    }

    // We need to strip metadata from stack frames before sending them to Sentry since these are client side only.
    client.on('beforeEnvelope', envelope => {
      utils.forEachEnvelopeItem(envelope, (item, type) => {
        if (type === 'event') {
          const event = Array.isArray(item) ? (item )[1] : undefined;

          if (event) {
            metadata.stripMetadataFromStackFrames(event);
            item[1] = event;
          }
        }
      });
    });

    const stackParser = client.getOptions().stackParser;

    addGlobalEventProcessor(event => {
      metadata.addMetadataToStackFrames(stackParser, event);
      return event;
    });
  }
} ModuleMetadata.__initStatic();

exports.ModuleMetadata = ModuleMetadata;
//# sourceMappingURL=metadata.js.map