node-gitlog
node-gitlog copied to clipboard
Should add more fields?



I'm not quite sure what you're asking for
const options: GitlogOptions<("subject" | "authorName" | "authorDate")[]> = {
repo: "foo",
fields: ["subject", "authorName", "authorDate"],
};
const commits = gitlog(options);
const options: GitlogOptions = {
repo: "foo",
fields: ["treeHash"],
};
const commits = gitlog(options);
Can be entered directly without the need for generics
the only problem is that in typescript we can't ensure commits has the right fields without the generic.
How do you like
const options = {
repo: "foo",
fields: ["subject", "authorName", "authorDate"] as const,
};
gitlog(options);