Updates a JSON file based on a provided update function.
The update function takes the file's current source string as a parameter and should return an object.
Parameters
filepath: string
The path to the file to update.
update: ((o) => Record<string | number, unknown>)
The function to update the file. Takes the parsed source string as a parameter and should return a string.
Updates a JSON file based on a provided update function. The update function takes the file's current source string as a parameter and should return an object.