Class Facet

Represents a facet

A facet is a filter for searching It consists of a type, an operation, and a value

// Facet where the version is "1.16.5"
new Facet(FacetType.Versions, FacetOperation.EQUALS, "1.16.5")
// Facet where the downloads are greater than 1000
new Facet(FacetType.Downloads, FacetOperation.GREATER_THAN, "1000")

Constructors

  • Creates a new Facet

    Parameters

    • type: FacetType

      The type of the facet

    • operation: FacetOperation

      The operation of the facet

    • value: string

      The value of the facet

    Returns Facet

    // Facet where the version is "1.16.5"
    new Facet(FacetType.Versions, FacetOperation.EQUALS, "1.16.5")
    // Facet where the downloads are greater than 1000
    new Facet(FacetType.Downloads, FacetOperation.GREATER_THAN, "1000")

Methods

  • Gets the value of the facet

    Returns string

    The value of the facet

  • Stringifies the facet

    Returns string

    The stringified facet