Skip to content

Commit 0299cac

Browse files
committed
Remove PhrasesList type
1 parent 5a8cf14 commit 0299cac

File tree

3 files changed

+16
-35
lines changed

3 files changed

+16
-35
lines changed

index.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/**
22
* @typedef {import('./lib/index.js').Handler} Handler
33
* @typedef {import('./lib/index.js').Options} Options
4-
* @typedef {import('./lib/index.js').PhrasesList} PhrasesList
54
*/
65

76
export {search} from './lib/index.js'

lib/index.js

+8-11
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,6 @@
2727
* Extra fields.
2828
* @property {boolean | null | undefined} [allowLiterals=false]
2929
* Include literal phrases (default: `false`).
30-
*
31-
* @typedef {Array<string>} PhrasesList
32-
* List of phrases.
33-
*
34-
* Each phrase is a space-separated list of words, where each word will be
35-
* normalized to remove casing, apostrophes, and dashes.
36-
* Spaces in a pattern mean one or more whitespace nodes in the tree.
37-
* Instead of a word with letters, it’s also possible to use a wildcard
38-
* symbol (`*`, an asterisk) which will match any word in a pattern
39-
* (`alpha * charlie`).
4030
*/
4131

4232
import {visit} from 'unist-util-visit'
@@ -48,9 +38,16 @@ const own = {}.hasOwnProperty
4838
/**
4939
* Search for phrases in a tree.
5040
*
41+
* Each phrase is a space-separated list of words, where each word will be
42+
* normalized to remove casing, apostrophes, and dashes.
43+
* Spaces in a pattern mean one or more whitespace nodes in the tree.
44+
* Instead of a word with letters, it’s also possible to use a wildcard
45+
* symbol (`*`, an asterisk) which will match any word in a pattern
46+
* (`alpha * charlie`).
47+
*
5148
* @param {Nodes} tree
5249
* Tree to search.
53-
* @param {PhrasesList} phrases
50+
* @param {Array<string>} phrases
5451
* Phrases to search for.
5552
* @param {Handler} handler
5653
* Handle a match

readme.md

+8-23
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
* [`search(tree, phrases, handler[, allowApostrophes|options])`](#searchtree-phrases-handler-allowapostrophesoptions)
2121
* [`Handler`](#handler)
2222
* [`Options`](#options)
23-
* [`PhrasesList`](#phraseslist)
2423
* [Types](#types)
2524
* [Compatibility](#compatibility)
2625
* [Related](#related)
@@ -113,6 +112,12 @@ There is no default export.
113112

114113
Search for phrases in a tree.
115114

115+
Each phrase is a space-separated list of words, where each word will be
116+
[normalized][nlcst-normalize] to remove casing, apostrophes, and dashes.
117+
Spaces in a pattern mean one or more whitespace nodes in the tree.
118+
Instead of a word with letters, it’s also possible to use a wildcard symbol
119+
(`*`, an asterisk) which will match any word in a pattern (`alpha * charlie`).
120+
116121
##### Parameters
117122

118123
* `tree` ([`Node`][node])
@@ -162,29 +167,11 @@ Configuration (TypeScript type).
162167
* `allowLiterals` (`boolean`, default: `false`)
163168
— include [literal][] phrases
164169

165-
### `PhrasesList`
166-
167-
List of phrases (TypeScript type).
168-
169-
Each phrase is a space-separated list of words, where each word will be
170-
[normalized][nlcst-normalize] to remove casing, apostrophes, and dashes.
171-
Spaces in a pattern mean one or more whitespace nodes in the tree.
172-
Instead of a word with letters, it’s also possible to use a wildcard symbol
173-
(`*`, an asterisk) which will match any word in a pattern (`alpha * charlie`).
174-
175-
###### Type
176-
177-
```ts
178-
type PhrasesList = Array<string>
179-
```
180-
181170
## Types
182171

183172
This package is fully typed with [TypeScript][].
184-
It exports the additional types
185-
[`Handler`][api-handler],
186-
[`Options`][api-options], and
187-
[`PhrasesList`][api-phrases-list].
173+
It exports the additional types [`Handler`][api-handler] and
174+
[`Options`][api-options].
188175

189176
## Compatibility
190177

@@ -278,5 +265,3 @@ abide by its terms.
278265
[api-handler]: #handler
279266

280267
[api-options]: #options
281-
282-
[api-phrases-list]: #phraseslist

0 commit comments

Comments
 (0)