@dynatrace/devkit
Version:
The Dynatrace App Toolkit utilities for writing and testing migrations.
19 lines (18 loc) • 1.08 kB
TypeScript
import type { FileMap } from './file-map';
/** Find a file inside the file map */
export declare function findFiles(fileMap: FileMap, glob: string): FileMap;
/** Helper function to read a file content */
export declare function readFile(fileMap: FileMap, filePath: string): string | undefined;
/** Helper function to delete a file */
export declare function deleteFile(fileMap: FileMap, filePath: string): FileMap;
/** Helper function to write a file */
export declare function writeFile(fileMap: FileMap, filePath: string, content: string): FileMap;
/** Helper function to update a file */
export declare function updateFile(fileMap: FileMap, filePath: string, modify: (content: string) => string): FileMap;
/** Helper function to update a json file */
export declare function updateJson<T = Record<string, unknown>>(fileMap: FileMap, filePath: string, modify: (content: T) => T): FileMap;
/**
* Merges multiple file maps into one, overrides duplicate file maps,
* only json files are getting merged.
*/
export declare function mergeFileMaps(...fileMaps: FileMap[]): FileMap;