Sha256: d0317903ebe69245f6cd08d7482e1b657d8e40cb77d53f2813e3b0860e90a87d

Contents?: true

Size: 1.47 KB

Versions: 21

Compression:

Stored size: 1.47 KB

Contents

const FIELDS = [
  { name: 'eventMatches', title: 'Events' },
  {
    name: 'returnValues',
    filterName: 'returnValue',
    title: 'Return values',
    valueTitle: 'Value',
  },
  {
    name: 'httpServerRequests',
    filterName: 'httpServerRequest',
    title: 'HTTP server requests',
    valueTitle: 'Route',
  },
  {
    name: 'sqlQueries',
    title: 'SQL queries',
    valueTitle: 'Query',
  },
  {
    name: 'sqlTables',
    title: 'SQL tables',
    valueTitle: 'Table',
  },
  {
    name: 'callers',
    filterName: 'caller',
    title: 'Callers',
    valueTitle: 'Name',
  },
  {
    name: 'ancestors',
    filterName: 'ancestor',
    title: 'Ancestors',
    valueTitle: 'Name',
  },
  { name: 'descendants', title: 'Descendants', valueTitle: 'Name' },
  { name: 'packageTrigrams', title: 'Package trigrams' },
  { name: 'classTrigrams', title: 'Class trigrams' },
  { name: 'functionTrigrams', title: 'Function trigrams' },
];

const Fields = {};

Fields.fields = FIELDS;

Fields.indexFromName = (name) => {
  for (let index = 0; index < FIELDS.length; index += 1) {
    if (FIELDS[index].name === name) {
      return index;
    }
  }
  throw new Error(`Invalid field name: ${name}`);
};

Fields.selectIndexes = (names) => {
  // eslint-disable-next-line no-param-reassign
  names = new Set([...names]);
  return FIELDS.map((f, index) => (names.has(f.name) ? index : null)).filter(
    (index) => index !== null
  );
};

Fields.fieldFromIndex = (index) => FIELDS[index];

module.exports = Fields;

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
appmap-0.72.2 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.72.1 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.72.0 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.71.0 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.70.2 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.70.1 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.70.0 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.69.0 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.68.2 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.68.1 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.68.0 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.67.1 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.67.0 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.66.2 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.66.1 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.66.0 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.65.1 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.65.0 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.64.0 ./node_modules/@appland/appmap/src/inspect/fields.js
appmap-0.63.0 ./node_modules/@appland/appmap/src/inspect/fields.js