* Check if a property has an index defined in the schema. * @param label The element label. * @param property The property name. * @returns The index configuration, or undefined if not indexed.
(label: string, property: string)
| 42 | * @returns The index configuration, or undefined if not indexed. |
| 43 | */ |
| 44 | public getIndexConfig(label: string, property: string): IndexConfig | undefined { |
| 45 | // Defensive check for incomplete schemas |
| 46 | const vertices = this.#schema.vertices; |
| 47 | if (vertices) { |
| 48 | const vertexSchema = vertices[label]; |
| 49 | if (vertexSchema?.properties[property]?.index) { |
| 50 | return vertexSchema.properties[property]!.index; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | const edges = this.#schema.edges; |
| 55 | if (edges) { |
| 56 | const edgeSchema = edges[label]; |
| 57 | if (edgeSchema?.properties[property]?.index) { |
| 58 | return edgeSchema.properties[property]!.index; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | return undefined; |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * Check if a property has an index of a specific type. |
no outgoing calls
no test coverage detected