File tree Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Expand file tree Collapse file tree 1 file changed +20
-4
lines changed Original file line number Diff line number Diff line change 44 * @typedef {Root|Content } Node
55 *
66 * @typedef Options
7- * @property {boolean } [allowDashes=false]
8- * @property {boolean } [allowApostrophes=false]
7+ * Configuration.
8+ * @property {boolean | null | undefined } [allowDashes=false]
9+ * Do not strip hyphens (`-`).
10+ *
11+ * The default is to remove the hyphen-minus character.
12+ * @property {boolean | null | undefined } [allowApostrophes=false]
13+ * Do not strip apostrophes (`'`).
14+ *
15+ * The default is to remove apostrophes.
916 */
1017
1118import { toString } from 'nlcst-to-string'
1219
1320/**
14- * @param {string|Node|Array<Content> } node
15- * @param {Options } [options={}]
21+ * Normalize a word for easier comparison.
22+ *
23+ * Always normalizes smart apostrophes (`’`) to straight apostrophes (`'`) and
24+ * lowercases alphabetical characters (`[A-Z]`).
25+ *
26+ * @param {string | Node | Array<Content> } node
27+ * Word.
28+ * @param {Options | null | undefined } [options]
29+ * Configuration.
30+ * @returns {string }
31+ * Normalized word.
1632 */
1733export function normalize ( node , options ) {
1834 let value = ( typeof node === 'string' ? node : toString ( node ) )
You can’t perform that action at this time.
0 commit comments