prefer arrow functions

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
marcin mikołajczak
2024-05-12 15:24:15 +02:00
parent afa677a375
commit cb7976bd3d
11 changed files with 134 additions and 121 deletions

View File

@ -13,7 +13,7 @@ const api = new Gitlab({
jobToken: CI_JOB_TOKEN,
});
async function main() {
const main = async () => {
await api.Releases.create(CI_PROJECT_ID!, {
name: CI_COMMIT_TAG,
tag_name: CI_COMMIT_TAG,
@ -26,6 +26,6 @@ async function main() {
}],
},
});
}
};
main();

View File

@ -2,7 +2,7 @@ import fs from 'fs';
import { join } from 'path';
/** Parse the changelog into an object. */
function parseChangelog(changelog: string): Record<string, string> {
const parseChangelog = (changelog: string): Record<string, string> => {
const result: Record<string, string> = {};
let currentVersion: string;
@ -16,15 +16,15 @@ function parseChangelog(changelog: string): Record<string, string> {
});
return result;
}
};
/** Get Markdown changes for a specific version. */
function getChanges(version: string) {
const getChanges = (version: string) => {
version = version.replace('v', '');
const content = fs.readFileSync(join(__dirname, '..', '..', 'CHANGELOG.md'), 'utf8');
const parsed = parseChangelog(content);
return (parsed[version] || '').trim();
}
};
export {
parseChangelog,