@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
38 lines (37 loc) • 1.51 kB
TypeScript
export interface Options {
/**
* source folder.
*/
src: string;
}
export declare class JsonMerge {
/**
* Recursively merges JSON files with the same name and same subPath from the sourceFolders into the JSON files
* in the targetFolderPath.
*
* @example
* src/assets/resources/strings/ <- targetFolderPath
* strings.json
* es/strings.json
* pt/strings.json
* [
* 'node_modules/@msft-sme/core/dist/assets/resources/strings',
* 'node_modules/@msft-sme/ng2/dist/assets/resources/strings'
* ] <- sourceFoldersPath
*
* src/assets/resources/strings/strings.json contents are merged with the contents of
* node_modules/@msft-sme/core/dist/assets/resources/strings/strings.json and
* node_modules/@msft-ng2/core/dist/assets/resources/strings/strings.json
* and the source file is overwritten by the merged content
*
* @param targetFolderPathRoot The path of the base folder where the destination files are placed.
* @param sourceFoldersPathRoot The array of paths to the source folders from where to read the JSON files to merge
*/
mergeJsonInFolders(targetFolderPathRoot: string, sourceFoldersPathRoot: string[]): any[];
private getFilePaths;
private mergeJsons;
private readJSON;
private isObject;
private isFunction;
private extend;
}