File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"lock" : false ,
3
+ "exclude" : [
4
+ " docs/**"
5
+ ],
3
6
"tasks" : {
4
7
"test" : " deno test --unstable -A --doc --parallel --shuffle --coverage=.coverage" ,
5
8
"check" : " deno check --unstable $(find . -name '*.ts')" ,
Original file line number Diff line number Diff line change @@ -111,7 +111,7 @@ function parseBlock(name: string, body: string): Option | undefined {
111
111
const reDefinition =
112
112
`^'${ name } '${ reShortNames } (?:${ reType } (?:${ reDefaults } )?)?(?:${ reTags } )?$` ;
113
113
const m1 = body . match ( new RegExp ( reDefinition , "dm" ) ) ;
114
- const type = m1 ?. groups ! . type ?? fallbackTypes [ name ] ;
114
+ const type = m1 ?. groups ? .type ?? fallbackTypes [ name ] ;
115
115
if ( ! m1 || ! isOptionType ( type ) ) {
116
116
// {name} not found, or {type} is invalid
117
117
return ;
@@ -124,12 +124,12 @@ function parseBlock(name: string, body: string): Option | undefined {
124
124
const scope = (
125
125
m2 ?. [ 1 ] . split ( " or " ) ?? [ "global" ]
126
126
) as Array < "global" | "local" > ;
127
- body = trimLines ( body . substring ( m2 ?. indices ! [ 0 ] [ 1 ] ?? 0 ) ) + "\n" ;
127
+ body = trimLines ( body . substring ( m2 ?. indices ?. at ( 0 ) ?. at ( 1 ) ?? 0 ) ) + "\n" ;
128
128
129
129
// Extract {attention}
130
130
const m3 = body . match ( / ^ \t { 3 , } ( \{ (?: V i [: ] | n o t | o n l y ) [ ^ { } ] * \} ) \s * ?\n / d) ;
131
131
const attention = m3 ?. [ 1 ] . replaceAll ( / \s + / g, " " ) . trim ( ) ;
132
- body = trimLines ( body . substring ( m3 ?. indices ! [ 0 ] [ 1 ] ?? 0 ) ) + "\n" ;
132
+ body = trimLines ( body . substring ( m3 ?. indices ?. at ( 0 ) ?. at ( 1 ) ?? 0 ) ) + "\n" ;
133
133
134
134
// Append {defaults} and {attention} to {document}
135
135
body += `\n\n${ defaults ?? "" } \n\n${ attention ?? "" } ` ;
You can’t perform that action at this time.
0 commit comments