MCPcopy Create free account
hub / github.com/angular/dev-infra / parseChangelogEntry

Function parseChangelogEntry

ng-dev/release/notes/changelog.ts:193–210  ·  view source on GitHub ↗

Parse the provided string into a ChangelogEntry object.

(content: string)

Source from the content-addressed store, hash-verified

191
192/** Parse the provided string into a ChangelogEntry object. */
193function parseChangelogEntry(content: string): ChangelogEntry {
194 const versionMatcherResult = versionAnchorMatcher.exec(content);
195 if (versionMatcherResult === null) {
196 throw Error(`Unable to determine version for changelog entry: ${content}`);
197 }
198 const version = semver.parse(versionMatcherResult[1]);
199
200 if (version === null) {
201 throw Error(
202 `Unable to determine version for changelog entry, with tag: ${versionMatcherResult[1]}`,
203 );
204 }
205
206 return {
207 content: content.trim(),
208 version,
209 };
210}

Callers 1

Calls 1

execMethod · 0.45

Tested by

no test coverage detected