mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +00:00
feat: add getLastModifiedDate
This commit is contained in:
parent
d07464b8b0
commit
01c6252754
2 changed files with 12 additions and 0 deletions
11
src/utils/getLastModifiedDate.ts
Normal file
11
src/utils/getLastModifiedDate.ts
Normal file
|
|
@ -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 { fetchXMLData } from './fetchXMLData';
|
||||||
export { getChecksum } from './getChecksum';
|
export { getChecksum } from './getChecksum';
|
||||||
export { getKebabCaseFromName } from './getKebabCaseFromName';
|
export { getKebabCaseFromName } from './getKebabCaseFromName';
|
||||||
|
export { getLastModifiedDate } from './getLastModifiedDate';
|
||||||
export { getLatestBinaryURL } from './getLatestBinaryURL';
|
export { getLatestBinaryURL } from './getLatestBinaryURL';
|
||||||
export { getOS } from './getOS';
|
export { getOS } from './getOS';
|
||||||
export { getParsedDate } from './getParsedDate';
|
export { getParsedDate } from './getParsedDate';
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue