Remove the use of "||=" which is not supported by Node 14 (and hidden by setup-node failing to configure Node 14 for CI workflow).

This commit is contained in:
David Anson 2023-02-25 16:24:24 -08:00
parent 13ced64c21
commit 0c48b4b032
2 changed files with 4 additions and 4 deletions

View file

@ -31,7 +31,7 @@ const {
function getMicromarkEvents(markdown, options = {}) {
// Customize options object to add useful extensions
options.extensions ||= [];
options.extensions = options.extensions || [];
options.extensions.push(gfmAutolinkLiteral, gfmFootnote(), gfmTable);
// Use micromark to parse document into Events
@ -182,7 +182,7 @@ function matchAndGetTokensByType(tokens, matchTypes, resultTypes) {
if (tokens.length !== matchTypes.length) {
return null;
}
resultTypes ||= matchTypes;
resultTypes = resultTypes || matchTypes;
const result = [];
// eslint-disable-next-line unicorn/no-for-loop
for (let i = 0; i < matchTypes.length; i++) {