#!/usr/bin/env node import { readFileSync } from 'node:fs' import { pathToFileURL } from 'node:url' const IMPACTS = new Set(['patch', 'minor', 'major', 'initial']) const FIELDS = ['schemaVersion', 'packages', 'summary', 'migration'] const isObject = value => value !== null && typeof value === 'object' && !Array.isArray(value) function readFence(line) { const delimiter = line[0] if (delimiter !== '`' && delimiter !== '~') return undefined let end = 1 while (line[end] === delimiter) end++ if (end < 3) return undefined return { marker: line.slice(0, end), info: line.slice(end) } } function closesFence(match, fence) { return ( match && match.marker[0] === fence[0] && match.marker.length >= fence.length && match.info.trim() === '' ) } function openingFence(line, comments) { let hidden = comments.active for (const token of line.matchAll(/