notes
이 리포지토리에서 노트용 새 이터레이터를 만들어요.
notesRef 인수는 사용할 참조의 표준 이름이고, 기본값은 "refs/notes/commits"예요.
시그니처
ts
class Repository {
notes(notesRef?: string | null | undefined): Notes;
}파라미터
- notesRefnull | string
사용할 참조의 표준 이름이에요.
반환 값
- Notes
모든 노트에 대한 이터레이터예요. 반환된 이터레이터는
[string, string]
쌍을 순서대로 제공하고, 첫 번째 요소는 노트의 ID이고 두 번째 요소는 그 노트가 주석을 다는 대상의 ID예요.
예제
ts
import { openRepository } from 'es-git';
const repo = await openRepository('.');
for (const { noteId, annotatedId } of repo.notes()) {
const note = repo.getNote(noteId);
const commit = repo.getCommit(annotatedId);
}