Skip to content

Commit

Permalink
use nullish coalescing
Browse files Browse the repository at this point in the history
Co-authored-by: Steven <steven@ceriously.com>
  • Loading branch information
UziTech and styfle committed Aug 12, 2023
1 parent aa881c5 commit 5b4dcd0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ export class Marked {
}
default: {
const genericToken = token as Tokens.Generic;
if (this.defaults.extensions && this.defaults.extensions.childTokens && this.defaults.extensions.childTokens[genericToken.type]) { // Walk any extensions
this.defaults.extensions.childTokens[genericToken.type].forEach((childTokens) => {
const array = this.defaults.extensions?.childTokens?.[genericToken.type] ?? []
// Walk any extensions
array.forEach((childTokens) => {
values = values.concat(this.walkTokens(genericToken[childTokens], callback));
});
} else if (genericToken.tokens) {
Expand Down

0 comments on commit 5b4dcd0

Please sign in to comment.