File tree Expand file tree Collapse file tree 3 files changed +23
-1
lines changed
Expand file tree Collapse file tree 3 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -39,3 +39,11 @@ if (hyphenateEnUsSyncWithMinWordLength("sabotaging") !== "sabotaging") {
3939 // sabotaging has 10 chars => don't hyphenate
4040 throw new Error ( "Test failed" ) ;
4141}
42+
43+ // Test with exceptions
44+ const hyphenateWithExceptions = createHyphenator ( hyphenationPatternsEnGb , {
45+ exceptions : [ "Bland-thorn" ] ,
46+ } ) as HyphenationFunctionSync ;
47+ if ( hyphenateWithExceptions ( "Blandthorn" ) !== "Bland-thorn" ) {
48+ throw new Error ( "Test failed" ) ;
49+ }
Original file line number Diff line number Diff line change @@ -43,6 +43,13 @@ declare namespace hyphen {
4343 * @default 5
4444 */
4545 minWordLength ?: number | undefined ;
46+
47+ /**
48+ * An array of values with exceptions of hyphenation in words.
49+ * Hard hyphen symbol `-` should be used to mark the position of further configured hyphenation symbol.
50+ * @default []
51+ */
52+ exceptions ?: string [ ] | undefined ;
4653 }
4754
4855 /**
@@ -66,6 +73,13 @@ declare namespace hyphen {
6673 * @default 5
6774 */
6875 minWordLength ?: number | undefined ;
76+
77+ /**
78+ * An array of values with exceptions of hyphenation in words.
79+ * Hard hyphen symbol `-` should be used to mark the position of further configured hyphenation symbol.
80+ * @default []
81+ */
82+ exceptions ?: string [ ] | undefined ;
6983 }
7084
7185 /**
Original file line number Diff line number Diff line change 11{
22 "private" : true ,
33 "name" : " @types/hyphen" ,
4- "version" : " 1.6 .9999" ,
4+ "version" : " 1.14 .9999" ,
55 "projects" : [
66 " https://github.com/ytiurin/hyphen"
77 ],
You can’t perform that action at this time.
0 commit comments