feat: add getLastModifiedDate
This commit is contained in:
parent
d07464b8b0
commit
01c6252754
|
@ -0,0 +1,11 @@
|
|||
import { LAST_COMMIT_BASE_URL } from '../constants';
|
||||
|
||||
export const getLastModifiedDate = async (filePath: string) =>
|
||||
fetch(`${LAST_COMMIT_BASE_URL}${filePath}/index.md&page=1&per_page=1`)
|
||||
.then(res => res.json())
|
||||
.then(commits => commits[0].commit.committer.date)
|
||||
.catch(_ =>
|
||||
fetch(`${LAST_COMMIT_BASE_URL}${filePath}.md&page=1&per_page=1`)
|
||||
.then(res => res.json())
|
||||
.then(commits => commits[0].commit.committer.date)
|
||||
);
|
|
@ -4,6 +4,7 @@ export { fetchLatestReleaseVersionAndName } from './fetchLatestReleaseVersionAnd
|
|||
export { fetchXMLData } from './fetchXMLData';
|
||||
export { getChecksum } from './getChecksum';
|
||||
export { getKebabCaseFromName } from './getKebabCaseFromName';
|
||||
export { getLastModifiedDate } from './getLastModifiedDate';
|
||||
export { getLatestBinaryURL } from './getLatestBinaryURL';
|
||||
export { getOS } from './getOS';
|
||||
export { getParsedDate } from './getParsedDate';
|
||||
|
|
Loading…
Reference in New Issue