@loopback/docs
Version:
Documentation files rendered at [https://loopback.io](https://loopback.io)
131 lines (62 loc) • 1.72 kB
Markdown
---
lang: en
title: 'API docs: rest.trie'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/rest
permalink: /doc/en/lb4/apidocs.rest.trie.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/rest](./rest.md) > [Trie](./rest.trie.md)
## Trie class
An implementation of trie for routes. The key hierarchy is built with parts of the route path delimited by `/`
**Signature:**
```typescript
export declare class Trie<T>
```
## Properties
<table><thead><tr><th>
Property
</th><th>
Modifiers
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
[root](./rest.trie.root.md)
</td><td markdown="1">
`readonly`
</td><td markdown="1">
[Node](./rest.node.md)<!-- --><T>
</td><td markdown="1">
</td></tr>
</tbody></table>
## Methods
<table><thead><tr><th>
Method
</th><th>
Modifiers
</th><th>
Description
</th></tr></thead>
<tbody><tr><td markdown="1">
[create(routeTemplate, value)](./rest.trie.create.md)
</td><td markdown="1">
</td><td markdown="1">
Create a node for a given path template
</td></tr>
<tr><td markdown="1">
[list()](./rest.trie.list.md)
</td><td markdown="1">
</td><td markdown="1">
List all nodes with value of the trie
</td></tr>
<tr><td markdown="1">
[match(path)](./rest.trie.match.md)
</td><td markdown="1">
</td><td markdown="1">
Match a route path against the trie
</td></tr>
</tbody></table>