Skip to content

getByDomain

The getByDomain function filters items by their assessment domain and returns them with sequential order IDs.

{input | getByDomain:domain}
  • input (object): An object containing items with assessment_domain property
  • domain (string): The domain to filter by

An object containing:

  • items: Array of filtered items, each with an added order_id property (starting from 1)
  • hasItems: Boolean indicating if any items were found
{assessments | getByDomain:"Network"}
// Returns: {
// items: [
// { ...item1, order_id: 1 },
// { ...item2, order_id: 2 }
// ],
// hasItems: true
// }
{findings | getByDomain:"Web Application" | get:"hasItems"}
// Returns: true or false
{controls | getByDomain:"Physical Security" | get:"items"}
// Returns array of physical security controls with order_id
{items | getByDomain:"NonExistent"}
// Returns: { items: [], hasItems: false }
{vulnerabilities | getByDomain:"Infrastructure" | get:"items"}
// Returns ordered list of infrastructure vulnerabilities
  • Organizing assessment findings by domain
  • Creating domain-specific report sections
  • Filtering security controls by category
  • Building ordered lists for specific domains
  • Conditional rendering based on domain presence
  • Automatically adds sequential order_id to each filtered item
  • Preserves all original item properties
  • Provides boolean flag for easy conditional checks
  • Maintains order of items as they appear in the input object