diff --git a/docs/README.md b/docs/README.md index a4c525b..6a84ed4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,4 +1,4 @@ -**@kamilmielnik/trie** • **Docs** +**@kamilmielnik/trie** *** diff --git a/docs/classes/Trie.md b/docs/classes/Trie.md index b397604..c2ff40a 100644 --- a/docs/classes/Trie.md +++ b/docs/classes/Trie.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -6,6 +6,8 @@ # Class: Trie +Defined in: [Trie.ts:18](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L18) + A class representing the [Trie data structure](https://en.wikipedia.org/wiki/Trie). ## Constructors @@ -14,11 +16,15 @@ A class representing the [Trie data structure](https://en.wikipedia.org/wiki/Tri > **new Trie**(`root`): [`Trie`](Trie.md) +Defined in: [Trie.ts:52](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L52) + Creates a new [Trie](Trie.md) with optionally given root [Node](../interfaces/Node.md). #### Parameters -• **root**: [`Node`](../interfaces/Node.md) = `{}` +##### root + +[`Node`](../interfaces/Node.md) = `{}` Root [Node](../interfaces/Node.md) of the [Trie](Trie.md) to be created. @@ -26,34 +32,32 @@ Root [Node](../interfaces/Node.md) of the [Trie](Trie.md) to be created. [`Trie`](Trie.md) -#### Defined in - -[Trie.ts:52](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L52) - ## Properties ### root > `readonly` **root**: [`Node`](../interfaces/Node.md) +Defined in: [Trie.ts:45](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L45) + Represents the root [Node](../interfaces/Node.md) of the [Trie](Trie.md). It's not a copy. Mutate at your own risk. -#### Defined in - -[Trie.ts:45](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L45) - ## Methods ### add() > **add**(`word`): [`Node`](../interfaces/Node.md) +Defined in: [Trie.ts:62](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L62) + Inserts given word into the [Trie](Trie.md). #### Parameters -• **word**: `string` +##### word + +`string` Word to be inserted into the [Trie](Trie.md). @@ -63,21 +67,21 @@ Word to be inserted into the [Trie](Trie.md). [Node](../interfaces/Node.md) representing the end of the added word. -#### Defined in - -[Trie.ts:62](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L62) - *** ### find() > **find**(`prefix`): `undefined` \| [`Node`](../interfaces/Node.md) +Defined in: [Trie.ts:72](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L72) + Finds [Node](../interfaces/Node.md) representing given prefix in the [Trie](Trie.md). #### Parameters -• **prefix**: `string` +##### prefix + +`string` Prefix to be found. @@ -87,21 +91,21 @@ Prefix to be found. [Node](../interfaces/Node.md) representing a given prefix, undefined if there is no such node. -#### Defined in - -[Trie.ts:72](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L72) - *** ### has() > **has**(`word`): `boolean` +Defined in: [Trie.ts:82](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L82) + Tells you whether given word is in the [Trie](Trie.md). #### Parameters -• **word**: `string` +##### word + +`string` Word to be found. @@ -111,23 +115,23 @@ Word to be found. true if given word is in the [Trie](Trie.md), false otherwise. -#### Defined in - -[Trie.ts:82](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L82) - *** ### hasPrefix() > **hasPrefix**(`prefix`): `boolean` +Defined in: [Trie.ts:94](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L94) + Tells you whether there are any words with given prefix in the [Trie](Trie.md). See: https://en.wikipedia.org/wiki/String_operations#Prefixes #### Parameters -• **prefix**: `string` +##### prefix + +`string` Prefix to be found. @@ -137,21 +141,21 @@ Prefix to be found. true if there are any words with given prefix in the [Trie](Trie.md), false otherwise. -#### Defined in - -[Trie.ts:94](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L94) - *** ### remove() > **remove**(`word`): `boolean` +Defined in: [Trie.ts:104](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L104) + Removes given word from the [Trie](Trie.md) if it exists. #### Parameters -• **word**: `string` +##### word + +`string` Word to be removed. @@ -161,16 +165,14 @@ Word to be removed. true if the word was removed, false otherwise. -#### Defined in - -[Trie.ts:104](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L104) - *** ### serialize() > **serialize**(): `string` +Defined in: [Trie.ts:121](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L121) + Converts the [Trie](Trie.md) into a string. The inverse of [deserialize](Trie.md#deserialize). @@ -187,21 +189,21 @@ It serializes [3 MB English (GB) dictionary](https://www.wordgamedictionary.com/ String with serialized data. -#### Defined in - -[Trie.ts:121](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L121) - *** ### toArray() > **toArray**(`options`?): [`Descendant`](../type-aliases/Descendant.md)[] +Defined in: [Trie.ts:131](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L131) + Finds all [descendants](../type-aliases/Descendant.md) of the [Trie's](Trie.md) root and returns them as an array. #### Parameters -• **options?**: [`TraverseOptions`](../type-aliases/TraverseOptions.md) +##### options? + +[`TraverseOptions`](../type-aliases/TraverseOptions.md) See [TraverseOptions](../type-aliases/TraverseOptions.md). @@ -211,25 +213,27 @@ See [TraverseOptions](../type-aliases/TraverseOptions.md). An array of [descendants](../type-aliases/Descendant.md). -#### Defined in - -[Trie.ts:131](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L131) - *** ### traverse() > **traverse**(`callback`, `options`?): `void` +Defined in: [Trie.ts:141](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L141) + Visits every descendant [Node](../interfaces/Node.md) of the [Trie](Trie.md) and calls a callback. #### Parameters -• **callback**: [`TraverseCallback`](../type-aliases/TraverseCallback.md) +##### callback + +[`TraverseCallback`](../type-aliases/TraverseCallback.md) Callback that will be called for each visited [Node](../interfaces/Node.md). Return true from callback to stop traversing. -• **options?**: [`TraverseOptions`](../type-aliases/TraverseOptions.md) +##### options? + +[`TraverseOptions`](../type-aliases/TraverseOptions.md) See [TraverseOptions](../type-aliases/TraverseOptions.md). @@ -237,23 +241,23 @@ See [TraverseOptions](../type-aliases/TraverseOptions.md). `void` -#### Defined in - -[Trie.ts:141](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L141) - *** ### deserialize() > `static` **deserialize**(`serialized`): [`Trie`](Trie.md) +Defined in: [Trie.ts:27](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L27) + Creates a new [Trie](Trie.md) by deserializing given string. The inverse of [serialize](Trie.md#serialize). #### Parameters -• **serialized**: `string` +##### serialized + +`string` String with serialized data. @@ -263,21 +267,21 @@ String with serialized data. [Trie](Trie.md) representing deserialized data. -#### Defined in - -[Trie.ts:27](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L27) - *** ### fromArray() > `static` **fromArray**(`words`): [`Trie`](Trie.md) +Defined in: [Trie.ts:37](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L37) + Creates a new [Trie](Trie.md) based on array of words. #### Parameters -• **words**: `string`[] +##### words + +`string`[] array of words to put in the [Trie](Trie.md). @@ -286,7 +290,3 @@ array of words to put in the [Trie](Trie.md). [`Trie`](Trie.md) New [Trie](Trie.md) containing all given words. - -#### Defined in - -[Trie.ts:37](https://github.com/kamilmielnik/trie/blob/master/src/Trie.ts#L37) diff --git a/docs/functions/add.md b/docs/functions/add.md index b4cf490..b672634 100644 --- a/docs/functions/add.md +++ b/docs/functions/add.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,15 +8,21 @@ > **add**(`node`, `word`): [`Node`](../interfaces/Node.md) +Defined in: [lib/add.ts:10](https://github.com/kamilmielnik/trie/blob/master/src/lib/add.ts#L10) + Inserts given `word` into given `node`. ## Parameters -• **node**: [`Node`](../interfaces/Node.md) +### node + +[`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) to insert the `word` to. -• **word**: `string` +### word + +`string` Word to be inserted into `node`. @@ -25,7 +31,3 @@ Word to be inserted into `node`. [`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) representing the end of the added word. - -## Defined in - -[lib/add.ts:10](https://github.com/kamilmielnik/trie/blob/master/src/lib/add.ts#L10) diff --git a/docs/functions/deserialize.md b/docs/functions/deserialize.md index 3b7d9d2..f6cb0b0 100644 --- a/docs/functions/deserialize.md +++ b/docs/functions/deserialize.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,13 +8,17 @@ > **deserialize**(`serialized`): [`Node`](../interfaces/Node.md) +Defined in: [lib/deserialize.ts:12](https://github.com/kamilmielnik/trie/blob/master/src/lib/deserialize.ts#L12) + Creates a new [Node](../interfaces/Node.md) by deserializing given string. The inverse of [serialize](serialize.md). ## Parameters -• **serialized**: `string` +### serialized + +`string` String with value returned by [serialize](serialize.md). @@ -23,7 +27,3 @@ String with value returned by [serialize](serialize.md). [`Node`](../interfaces/Node.md) Instance of a root [Node](../interfaces/Node.md) of deserialized string. - -## Defined in - -[lib/deserialize.ts:12](https://github.com/kamilmielnik/trie/blob/master/src/lib/deserialize.ts#L12) diff --git a/docs/functions/find.md b/docs/functions/find.md index 360a473..2a1c198 100644 --- a/docs/functions/find.md +++ b/docs/functions/find.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,15 +8,21 @@ > **find**(`node`, `prefix`): `undefined` \| [`Node`](../interfaces/Node.md) +Defined in: [lib/find.ts:10](https://github.com/kamilmielnik/trie/blob/master/src/lib/find.ts#L10) + Finds [Node](../interfaces/Node.md) representing given prefix in given [Node](../interfaces/Node.md). ## Parameters -• **node**: [`Node`](../interfaces/Node.md) +### node + +[`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) to look for prefix in. -• **prefix**: `string` +### prefix + +`string` Prefix to be found. @@ -25,7 +31,3 @@ Prefix to be found. `undefined` \| [`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) representing a given prefix, undefined if there is no such node. - -## Defined in - -[lib/find.ts:10](https://github.com/kamilmielnik/trie/blob/master/src/lib/find.ts#L10) diff --git a/docs/functions/fromArray.md b/docs/functions/fromArray.md index 14a84e0..1b28bef 100644 --- a/docs/functions/fromArray.md +++ b/docs/functions/fromArray.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,11 +8,15 @@ > **fromArray**(`words`): [`Node`](../interfaces/Node.md) +Defined in: [lib/fromArray.ts:11](https://github.com/kamilmielnik/trie/blob/master/src/lib/fromArray.ts#L11) + Creates a new [Node](../interfaces/Node.md) based on array of words. ## Parameters -• **words**: `string`[] +### words + +`string`[] array of words to put in the [Node](../interfaces/Node.md). @@ -21,7 +25,3 @@ array of words to put in the [Node](../interfaces/Node.md). [`Node`](../interfaces/Node.md) New [Node](../interfaces/Node.md) containing all given words. - -## Defined in - -[lib/fromArray.ts:11](https://github.com/kamilmielnik/trie/blob/master/src/lib/fromArray.ts#L11) diff --git a/docs/functions/has.md b/docs/functions/has.md index 951db94..74cecf3 100644 --- a/docs/functions/has.md +++ b/docs/functions/has.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,15 +8,21 @@ > **has**(`node`, `word`): `boolean` +Defined in: [lib/has.ts:12](https://github.com/kamilmielnik/trie/blob/master/src/lib/has.ts#L12) + Tells you whether given word is in the [Node](../interfaces/Node.md). ## Parameters -• **node**: [`Node`](../interfaces/Node.md) +### node + +[`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) to look for word in. -• **word**: `string` +### word + +`string` Word to be found. @@ -25,7 +31,3 @@ Word to be found. `boolean` true if given word is in the [Node](../interfaces/Node.md), false otherwise. - -## Defined in - -[lib/has.ts:12](https://github.com/kamilmielnik/trie/blob/master/src/lib/has.ts#L12) diff --git a/docs/functions/hasPrefix.md b/docs/functions/hasPrefix.md index d37817e..f12fef3 100644 --- a/docs/functions/hasPrefix.md +++ b/docs/functions/hasPrefix.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,17 +8,23 @@ > **hasPrefix**(`node`, `prefix`): `boolean` +Defined in: [lib/hasPrefix.ts:14](https://github.com/kamilmielnik/trie/blob/master/src/lib/hasPrefix.ts#L14) + Tells you whether there are any words with given prefix in the [Node](../interfaces/Node.md). See: https://en.wikipedia.org/wiki/String_operations#Prefixes ## Parameters -• **node**: [`Node`](../interfaces/Node.md) +### node + +[`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) to look for prefix in. -• **prefix**: `string` +### prefix + +`string` Prefix to be found. @@ -27,7 +33,3 @@ Prefix to be found. `boolean` true if there are any words with given prefix in the [Node](../interfaces/Node.md), false otherwise. - -## Defined in - -[lib/hasPrefix.ts:14](https://github.com/kamilmielnik/trie/blob/master/src/lib/hasPrefix.ts#L14) diff --git a/docs/functions/nodeKeyComparator.md b/docs/functions/nodeKeyComparator.md index 2c15736..d119f68 100644 --- a/docs/functions/nodeKeyComparator.md +++ b/docs/functions/nodeKeyComparator.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,16 +8,22 @@ > **nodeKeyComparator**(`key1`, `key2`): `number` +Defined in: [lib/nodeKeyComparator.ts:9](https://github.com/kamilmielnik/trie/blob/master/src/lib/nodeKeyComparator.ts#L9) + Comparator that allows sorting [Node](../interfaces/Node.md) keys alphabetically with the exception of "wordEnd" which should always come first. ## Parameters -• **key1**: `string` +### key1 + +`string` First key to compare. -• **key2**: `string` +### key2 + +`string` Second key to compare. @@ -26,7 +32,3 @@ Second key to compare. `number` -1 if key1 should precede key2, 0 if they're the same, 1 if key2 should precede key1. - -## Defined in - -[lib/nodeKeyComparator.ts:9](https://github.com/kamilmielnik/trie/blob/master/src/lib/nodeKeyComparator.ts#L9) diff --git a/docs/functions/remove.md b/docs/functions/remove.md index 660894d..5491523 100644 --- a/docs/functions/remove.md +++ b/docs/functions/remove.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,15 +8,21 @@ > **remove**(`node`, `word`): `boolean` +Defined in: [lib/remove.ts:10](https://github.com/kamilmielnik/trie/blob/master/src/lib/remove.ts#L10) + Removes given word from given [Node](../interfaces/Node.md) if it exists. ## Parameters -• **node**: [`Node`](../interfaces/Node.md) +### node + +[`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) to remove word from. -• **word**: `string` +### word + +`string` Word to be removed. @@ -25,7 +31,3 @@ Word to be removed. `boolean` true if the word was removed, false otherwise. - -## Defined in - -[lib/remove.ts:10](https://github.com/kamilmielnik/trie/blob/master/src/lib/remove.ts#L10) diff --git a/docs/functions/serialize.md b/docs/functions/serialize.md index 8797d11..770020b 100644 --- a/docs/functions/serialize.md +++ b/docs/functions/serialize.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,6 +8,8 @@ > **serialize**(`node`): `string` +Defined in: [lib/serialize.ts:37](https://github.com/kamilmielnik/trie/blob/master/src/lib/serialize.ts#L37) + Converts given [Node](../interfaces/Node.md) into a string. The inverse of [deserialize](deserialize.md). @@ -20,7 +22,9 @@ It serializes [3 MB English (GB) dictionary](https://www.wordgamedictionary.com/ ## Parameters -• **node**: [`Node`](../interfaces/Node.md) +### node + +[`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) to serialize. @@ -29,7 +33,3 @@ It serializes [3 MB English (GB) dictionary](https://www.wordgamedictionary.com/ `string` String with serialized data. - -## Defined in - -[lib/serialize.ts:37](https://github.com/kamilmielnik/trie/blob/master/src/lib/serialize.ts#L37) diff --git a/docs/functions/toArray.md b/docs/functions/toArray.md index d5efe61..f5c326c 100644 --- a/docs/functions/toArray.md +++ b/docs/functions/toArray.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,15 +8,21 @@ > **toArray**(`node`, `options`?): [`Descendant`](../type-aliases/Descendant.md)[] +Defined in: [lib/toArray.ts:12](https://github.com/kamilmielnik/trie/blob/master/src/lib/toArray.ts#L12) + Finds all [descendants](../type-aliases/Descendant.md) of given [Node](../interfaces/Node.md) and returns them as an array. ## Parameters -• **node**: [`Node`](../interfaces/Node.md) +### node + +[`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) to look for [descendants](../type-aliases/Descendant.md) in. -• **options?**: [`TraverseOptions`](../type-aliases/TraverseOptions.md) +### options? + +[`TraverseOptions`](../type-aliases/TraverseOptions.md) See [TraverseOptions](../type-aliases/TraverseOptions.md). @@ -25,7 +31,3 @@ See [TraverseOptions](../type-aliases/TraverseOptions.md). [`Descendant`](../type-aliases/Descendant.md)[] An array of [descendants](../type-aliases/Descendant.md). - -## Defined in - -[lib/toArray.ts:12](https://github.com/kamilmielnik/trie/blob/master/src/lib/toArray.ts#L12) diff --git a/docs/functions/traverse.md b/docs/functions/traverse.md index 8f1b478..3e2488a 100644 --- a/docs/functions/traverse.md +++ b/docs/functions/traverse.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,26 +8,30 @@ > **traverse**(`node`, `callback`, `options`): `void` +Defined in: [lib/traverse.ts:17](https://github.com/kamilmielnik/trie/blob/master/src/lib/traverse.ts#L17) + Visits every descendant [Node](../interfaces/Node.md) of given [Node](../interfaces/Node.md) and calls a callback. ## Parameters -• **node**: [`Node`](../interfaces/Node.md) +### node + +[`Node`](../interfaces/Node.md) [Node](../interfaces/Node.md) to look for descendant [Nodes](../interfaces/Node.md) in. -• **callback**: [`TraverseCallback`](../type-aliases/TraverseCallback.md) +### callback + +[`TraverseCallback`](../type-aliases/TraverseCallback.md) Callback that will be called for each visited [Node](../interfaces/Node.md). Return true from callback to stop traversing. -• **options**: [`TraverseOptions`](../type-aliases/TraverseOptions.md) = `{}` +### options + +[`TraverseOptions`](../type-aliases/TraverseOptions.md) = `{}` See [TraverseOptions](../type-aliases/TraverseOptions.md). ## Returns `void` - -## Defined in - -[lib/traverse.ts:17](https://github.com/kamilmielnik/trie/blob/master/src/lib/traverse.ts#L17) diff --git a/docs/interfaces/Node.md b/docs/interfaces/Node.md index 243574e..0a09267 100644 --- a/docs/interfaces/Node.md +++ b/docs/interfaces/Node.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -6,6 +6,8 @@ # Interface: Node +Defined in: [types.ts:5](https://github.com/kamilmielnik/trie/blob/master/src/types.ts#L5) + Keys are single characters (strings of length 1) or "wordEnd". "wordEnd: true" indicates that keys of all parent [Nodes](Node.md) make a valid word when joined together. @@ -13,12 +15,14 @@ Keys are single characters (strings of length 1) or "wordEnd". - `Record`\<`string`, [`Node`](Node.md) \| `true` \| `undefined`\> +## Indexable + +\[`key`: `string`\]: `undefined` \| `true` \| [`Node`](Node.md) + ## Properties ### wordEnd? > `optional` **wordEnd**: `true` -#### Defined in - -[types.ts:6](https://github.com/kamilmielnik/trie/blob/master/src/types.ts#L6) +Defined in: [types.ts:6](https://github.com/kamilmielnik/trie/blob/master/src/types.ts#L6) diff --git a/docs/type-aliases/Descendant.md b/docs/type-aliases/Descendant.md index 96cbd84..7ebcc05 100644 --- a/docs/type-aliases/Descendant.md +++ b/docs/type-aliases/Descendant.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,6 +8,8 @@ > **Descendant**: `object` +Defined in: [types.ts:11](https://github.com/kamilmielnik/trie/blob/master/src/types.ts#L11) + ## Type declaration ### node @@ -17,7 +19,3 @@ ### prefix > **prefix**: `string` - -## Defined in - -[types.ts:11](https://github.com/kamilmielnik/trie/blob/master/src/types.ts#L11) diff --git a/docs/type-aliases/TraverseCallback.md b/docs/type-aliases/TraverseCallback.md index bff8935..87a7097 100644 --- a/docs/type-aliases/TraverseCallback.md +++ b/docs/type-aliases/TraverseCallback.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,14 +8,14 @@ > **TraverseCallback**: (`descendant`) => `boolean` \| `void` +Defined in: [types.ts:9](https://github.com/kamilmielnik/trie/blob/master/src/types.ts#L9) + ## Parameters -• **descendant**: [`Descendant`](Descendant.md) +### descendant + +[`Descendant`](Descendant.md) ## Returns `boolean` \| `void` - -## Defined in - -[types.ts:9](https://github.com/kamilmielnik/trie/blob/master/src/types.ts#L9) diff --git a/docs/type-aliases/TraverseOptions.md b/docs/type-aliases/TraverseOptions.md index 869c4ab..0b75986 100644 --- a/docs/type-aliases/TraverseOptions.md +++ b/docs/type-aliases/TraverseOptions.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,6 +8,8 @@ > **TraverseOptions**: `object` +Defined in: [types.ts:16](https://github.com/kamilmielnik/trie/blob/master/src/types.ts#L16) + ## Type declaration ### prefix? @@ -31,7 +33,3 @@ Defaults to false. Set to true to only visit [Nodes](../interfaces/Node.md) representing complete words. Defaults to false. - -## Defined in - -[types.ts:16](https://github.com/kamilmielnik/trie/blob/master/src/types.ts#L16) diff --git a/docs/variables/CLOSE_PARENS.md b/docs/variables/CLOSE_PARENS.md index d8b274e..405bef0 100644 --- a/docs/variables/CLOSE_PARENS.md +++ b/docs/variables/CLOSE_PARENS.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,8 +8,6 @@ > `const` **CLOSE\_PARENS**: `")"` = `')'` -Represents end of a node in serialized format. - -## Defined in +Defined in: [constants.ts:4](https://github.com/kamilmielnik/trie/blob/master/src/constants.ts#L4) -[constants.ts:4](https://github.com/kamilmielnik/trie/blob/master/src/constants.ts#L4) +Represents end of a node in serialized format. diff --git a/docs/variables/OPEN_PARENS.md b/docs/variables/OPEN_PARENS.md index 40db977..531e8b8 100644 --- a/docs/variables/OPEN_PARENS.md +++ b/docs/variables/OPEN_PARENS.md @@ -1,4 +1,4 @@ -[**@kamilmielnik/trie**](../README.md) • **Docs** +[**@kamilmielnik/trie**](../README.md) *** @@ -8,8 +8,6 @@ > `const` **OPEN\_PARENS**: `"("` = `'('` -Represents start of a node in serialized format. - -## Defined in +Defined in: [constants.ts:9](https://github.com/kamilmielnik/trie/blob/master/src/constants.ts#L9) -[constants.ts:9](https://github.com/kamilmielnik/trie/blob/master/src/constants.ts#L9) +Represents start of a node in serialized format. diff --git a/package.json b/package.json index 1d3c3b5..1427488 100644 --- a/package.json +++ b/package.json @@ -42,14 +42,14 @@ "access": "public" }, "scripts": { - "clean": "rimraf build coverage docs", "build": "tsc --project .", "build:docs": "typedoc", + "clean": "rimraf build coverage docs", "postbuild": "npm run build:docs", - "prettier": "prettier --list-different './src/**/*.{js,ts}'", - "prettier:fix": "npm run prettier -- --write", "prebuild": "npm run clean", "prerelease": "npm run test && npm run build && npm run build:docs", + "prettier": "prettier --list-different './src/**/*.{js,ts}'", + "prettier:fix": "npm run prettier -- --write", "release": "np", "test": "jest", "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand",