UNPKG

@atomist/automation-client

Version:

Atomist API for software low-level client

22 lines 1.03 kB
import { ProjectAsync } from "../Project"; export declare type JsonManipulation<M = any> = (jsonObj: M) => 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<M>): 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<M = any>(jsonIn: string, manipulation: JsonManipulation<M>, context?: string): string; //# sourceMappingURL=jsonUtils.d.ts.map