(changelogEntry, targetPath)
| 12 | * @return {void} |
| 13 | */ |
| 14 | export function prependDatedEntry(changelogEntry, targetPath) { |
| 15 | // Build a `yyyy-mm-dd`-formatted date string |
| 16 | // and tag the changelog entry with it |
| 17 | const todayString = new Date().toISOString().slice(0, 10) |
| 18 | changelogEntry.date = todayString |
| 19 | |
| 20 | const previousChangelogString = fs.readFileSync(targetPath) |
| 21 | const previousChangelog = JSON.parse(previousChangelogString) |
| 22 | // add a new entry to the changelog data |
| 23 | previousChangelog.unshift(changelogEntry) |
| 24 | // rewrite the updated changelog |
| 25 | fs.writeFileSync(targetPath, JSON.stringify(previousChangelog, null, 2)) |
| 26 | } |
| 27 | |
| 28 | /** |
| 29 | * Compare `oldSchemaString` to `newSchemaString`, and if there are any |
no outgoing calls
no test coverage detected