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

Method getEntriesFor

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

* Retrieve the changelog entries for the provide changelog path, if the file does not exist an * empty array is returned.

(path: string)

Source from the content-addressed store, hash-verified

171 * empty array is returned.
172 */
173 private getEntriesFor(path: string): ChangelogEntry[] {
174 if (!existsSync(path)) {
175 return [];
176 }
177
178 return (
179 readFileSync(path, {encoding: 'utf8'})
180 // Use the versionMarker as the separator for .split().
181 .split(splitMarker)
182 // If the `split()` method finds the separator at the beginning or end of a string, it
183 // includes an empty string at the respective locaiton, so we filter to remove all of these
184 // potential empty strings.
185 .filter((entry) => entry.trim().length !== 0)
186 // Create a ChangelogEntry for each of the string entry.
187 .map(parseChangelogEntry)
188 );
189 }
190}
191
192/** Parse the provided string into a ChangelogEntry object. */

Callers 2

entriesMethod · 0.95
archiveEntriesMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected