lib/tasks/jsdoc/generateJsdoc.js
async function writeDependencyApisToDir({dependencies, targetPath}) {
	const depApis = await dependencies.byGlob("/test-resources/**/designtime/api.json");

	// Clone resources before changing their path
	const apis = await Promise.all(depApis.map((resource) => resource.clone()));

	for (let i = 0; i < apis.length; i++) {
		apis[i].setPath(`/api-${i}.json`);
	}

	const fsTarget = resourceFactory.createAdapter({
		fsBasePath: targetPath,
		virBasePath: "/"
	});
	await Promise.all(apis.map((resource) => fsTarget.write(resource)));
	return apis.length;
}
async function writeDependencyApisToDir({dependencies, targetPath}) {
	const depApis = await dependencies.byGlob("/test-resources/**/designtime/api.json");

	// Clone resources before changing their path
	const apis = await Promise.all(depApis.map((resource) => resource.clone()));

	for (let i = 0; i < apis.length; i++) {
		apis[i].setPath(`/api-${i}.json`);
	}

	const fsTarget = resourceFactory.createAdapter({
		fsBasePath: targetPath,
		virBasePath: "/"
	});
	await Promise.all(apis.map((resource) => fsTarget.write(resource)));
	return apis.length;
}
async function writeDependencyApisToDir ( { dependencies , targetPath } ) { const depApis = await dependencies . byGlob ( "/test-resources/**/designtime/api.json" ) ; // Clone resources before changing their path const apis = await Promise . all ( depApis . map ( ( resource ) => resource . clone ( ) ) ) ; for ( let i = 0 ; i < apis . length ; i ++ ) { apis [ i ] . setPath ( ` ${ i } ` ) ; } const fsTarget = resourceFactory . createAdapter ( { fsBasePath : targetPath , virBasePath : "/" } ) ; await Promise . all ( apis . map ( ( resource ) => fsTarget . write ( resource ) ) ) ; return apis . length ; }
Write api.json files of dependencies to given target path in a flat structure

@private
@param {Object} parameters Parameters
@param {module:@ui5/fs.AbstractReader} parameters.dependencies Reader or Collection to read dependency files
@param {string} parameters.targetPath Path to write the resources to
@returns {Promise<number>} Promise resolving with number of resources written to given directory
Write api . json files of dependencies to given target path in a flat structure