Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove unreachable code
  • Loading branch information
romainmenke committed Nov 26, 2025
commit afa30d3c367dd9e9effca35dde14ed0ddb1a9ec3
9 changes: 3 additions & 6 deletions lib/utils/mergeSyntaxDefinitions.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions lib/utils/mergeSyntaxDefinitions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* @returns {SyntaxDefinition}
*/
export default function mergeSyntaxDefinitions(...sources) {
/** @type {SyntaxDefinition} */
/** @type {SyntaxDefinition|undefined} */
let target = sources[0] ?? {};

for (let i = 1; i < sources.length; i++) {
Expand All @@ -30,14 +30,11 @@ export default function mergeSyntaxDefinitions(...sources) {
* Merge two separate syntax definitions.
* Individual definitions will override each other unless the second definition starts with a pipe symbol `|`.
*
* @param {SyntaxDefinition | undefined} source1
* @param {SyntaxDefinition | undefined} source2
* @param {SyntaxDefinition} source1
* @param {SyntaxDefinition} source2
* @returns {SyntaxDefinition}
*/
function mergeTwoSyntaxDefinitions(source1, source2) {
if (typeof source1 === 'undefined' || typeof source2 === 'undefined')
return source1 ?? source2 ?? {};

/** @type {SyntaxDefinition} */
const target = {};

Expand Down
Loading