How to use metro-symbolicate - 3 common examples

To help you get started, we’ve selected a few metro-symbolicate 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 facebook / metro / packages / metro / src / Server / symbolicate.js View on Github external
function createFunctionNameGetter(
  module: ExplodedSourceMapModule,
): Position => ?string {
  const consumer = new SourceMetadataMapConsumer(
    {
      version: 3,
      mappings: '',
      sources: ['dummy'],
      names: [],
      x_facebook_sources: [[module.functionMap]],
    },
    name => name /* no normalization needed */,
  );
  return ({line1Based, column0Based}) =>
    consumer.functionNameFor({
      line: line1Based,
      column: column0Based,
      source: 'dummy',
    });
}
github facebook / metro / packages / metro / src / Server / symbolicate / worker.js View on Github external
function mapFrame(frame, contexts) {
  const sourceUrl = frame.file;
  const context = contexts.get(sourceUrl);
  if (context == null) {
    return frame;
  }
  const original = Symbolication.getOriginalPositionFor(
    frame.lineNumber,
    frame.column,
    null, // No module IDs in DEV
    context,
  );
  if (!original || !original.source) {
    return frame;
  }
  return Object.assign({}, frame, {
    file: original.source,
    lineNumber: original.line,
    column: original.column,
    methodName: original.name || frame.methodName,
  });
}
github facebook / metro / packages / metro / src / Server / symbolicate / worker.js View on Github external
function mapToContext(tuple) {
  tuple[1] = Symbolication.createContext(SourceMapConsumer, tuple[1]);
  return tuple;
}

metro-symbolicate

🚇 A tool to find the source location from JS bundles and stack traces.

MIT
Latest version published 25 days ago

Package Health Score

95 / 100
Full package analysis