Skip to content

Commit

Permalink
Move default options to separate var
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinovantes committed Jun 30, 2024
1 parent 8d2dd65 commit f68cacd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/Generator/RstGeneratorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export type RstGeneratorOptions = {
}

export function createDefaultGeneratorOptions(opts?: Partial<RstGeneratorOptions>): RstGeneratorOptions {
return merge({
const defaultOpts: RstGeneratorOptions = {
disableWarnings: false,
disableErrors: false,

Expand Down Expand Up @@ -158,5 +158,7 @@ export function createDefaultGeneratorOptions(opts?: Partial<RstGeneratorOptions

defaultLiteralBlockLanguage: 'txt',
defaultSyntaxLanguage: '',
} satisfies RstGeneratorOptions, opts)
}

return merge(defaultOpts, opts)
}
6 changes: 4 additions & 2 deletions src/Parser/RstParserOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export type RstParserOptions = {
}

export function createDefaultParserOptions(opts?: Partial<RstParserOptions>): RstParserOptions {
return merge({
const defaultOpts: RstParserOptions = {
disableWarnings: false,
disableErrors: false,

Expand All @@ -72,5 +72,7 @@ export function createDefaultParserOptions(opts?: Partial<RstParserOptions>): Rs
directivesWithInitContent: [],

epilog: '',
} satisfies RstParserOptions, opts)
}

return merge(defaultOpts, opts)
}

0 comments on commit f68cacd

Please sign in to comment.