lib/robots/utils
Functions
'Read the “', Functions, '” section'getFileSizeInKilobytes()
'Read the “', getFileSizeInKilobytes(), '” section'function getFileSizeInKilobytes(filename: URL): number
Defined in: studiocms/packages/studiocms/src/lib/robots/utils.ts:34
Calculates the size of a file in kilobytes.
Parameters
'Read the “', Parameters, '” section'URL
The URL of the file to get the size of.
number
The size of the file in kilobytes.
measureExecutionTime()
'Read the “', measureExecutionTime(), '” section'function measureExecutionTime(callback: () => void): number
Defined in: studiocms/packages/studiocms/src/lib/robots/utils.ts:20
Measures the execution time of a given callback function.
Parameters
'Read the “', Parameters, '” section'() => void
The function whose execution time is to be measured.
number
The execution time of the callback function in milliseconds.
readJson()
'Read the “', readJson(), '” section'function readJson<T>(path: string | URL): T
Defined in: studiocms/packages/studiocms/src/lib/robots/utils.ts:10
Reads a JSON file from the specified path and parses its content.
Type Parameters
'Read the “', Type Parameters, '” section'• T
The type of the parsed JSON object.
Parameters
'Read the “', Parameters, '” section'The path to the JSON file.
string
| URL
T
The parsed JSON object.