tickle/modules/utils/fetchContentLength.mjs

14 lines
411 B
JavaScript
Raw Permalink Normal View History

2023-06-06 22:45:16 +00:00
//@ts-check
import {decodeContentLength} from './decodeContentLength.mjs'
import {fetchHeaders} from './fetchHeaders.mjs'
/**
* Attempts to retrieve the size of an object represented by a URL with a
* limited fetch request.
* @see {decodeContentLength}
* @param {string} path
*/
export const fetchContentLength = (path) =>
fetchHeaders(path).then(decodeContentLength);
export default fetchContentLength