UNPKG

@atomist/automation-client

Version:
22 lines 1.01 kB
import { ProjectAsync } from "../Project"; export declare type JsonManipulation = (jsonObj: any) => void; /** * Manipulate the contents of the given JSON file within the project, * using its object form and writing back using the same formatting. * See the manipulate function. * @param {P} p * @param {string} jsonPath JSON file path. This function will do nothing * without error if the file is ill-formed or not found. * @param {JsonManipulation} manipulation * @return {Promise<P extends ProjectAsync>} */ export declare function doWithJson<M, P extends ProjectAsync = ProjectAsync>(p: P, jsonPath: string, manipulation: JsonManipulation): Promise<P>; /** * Update the object form of the given JSON content and write * it back with minimal changes * @param {string} jsonIn * @param {(jsonObj: any) => Object} manipulation * @return {string} */ export declare function manipulate(jsonIn: string, manipulation: JsonManipulation, context?: string): string; //# sourceMappingURL=jsonUtils.d.ts.map