Files
fleet/frontend/utilities/osquery_tables.ts
T
arya rizky 3db440a36a fix: correct typo 'explicity' to 'explicitly' in comment (#45820)
This is an independent contribution.

## Summary

Corrects a spelling error in a code comment in
`frontend/utilities/osquery_tables.ts`.

## Changes

- `frontend/utilities/osquery_tables.ts`: 1 character changed (`+1 -1`)

## Root Cause

The comment reads "Typecasting explicity here" — a misspelling of
"explicitly".

## Testing

- Comment-only change — no functional impact

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
  * Corrected a spelling error in code comments for improved clarity.

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/fleetdm/fleet/pull/45820?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-20 11:54:14 +02:00

54 lines
1.8 KiB
TypeScript

import { flatMap } from "lodash";
import { IOsQueryTable } from "interfaces/osquery_table";
import osqueryFleetTablesJSON from "../../schema/osquery_fleet_schema.json";
// Typecasting explicitly here as we are adding more rigid types such as
// OsqueryPlatform for platform names, instead of just any strings.
const queryTable = osqueryFleetTablesJSON as IOsQueryTable[];
export const osqueryTables = queryTable.sort((a, b) => {
return a.name >= b.name ? 1 : -1;
});
// Note: Hiding tables where key hidden is set to true
export const osqueryTablesAvailable = osqueryTables.filter(
(table) => !table.hidden
);
// Note: Hiding tables where key hidden is set to true
export const osqueryTableNames = flatMap(osqueryTables, (table) => {
return table.hidden ? [] : table.name;
});
// Note: Hiding columns where table key hidden is set to true
export const osqueryTableColumnNames = flatMap(osqueryTables, (table) => {
const tableColumnNames = flatMap(table.columns, (column) => column.name);
return table.hidden ? [] : tableColumnNames;
});
// Note: Hiding columns where table key hidden is set to true
export const osqueryTableColumns = flatMap(osqueryTables, (table) => {
return table.hidden ? [] : table.columns;
});
// Note: Hiding columns where table key hidden is set to true or if tables are defined but it doesn't include that table
export const selectedTableColumns = (selectedTables: string[]) => {
const columnsFilteredBySelection = flatMap(osqueryTables, (table) => {
const hideColumns = () => {
if (table.hidden) {
return true;
}
if (selectedTables.length > 0 && !selectedTables.includes(table.name)) {
return true;
}
return false;
};
return hideColumns() ? [] : table.columns;
});
return columnsFilteredBySelection;
};