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