packages/generator-liferay-theme/lib/utils/config.js
/**
 * Reads a JSON file returning an empty object if the file does not exist.
 * @param {string} path
 * @return {object}
 */
Reads a JSON file returning an empty object if the file does not exist.
@param {string} path
@return {object}
Reads a JSON file returning an empty object if the file does not exist . @param { string } path @return { object }
function safeReadJsonSync(path) {
	try {
		return fs.readJsonSync(path);
	} catch (err) {
		if (err.code !== 'ENOENT') {
			throw err;
		}
		return {};
	}
}
function safeReadJsonSync ( path ) { try { return fs . readJsonSync ( path ) ; } catch ( err ) { if ( err . code !== 'ENOENT' ) { throw err ; } return { } ; } }
Reads a JSON file returning an empty object if the file does not exist.
Reads a JSON file returning an empty object if the file does not exist .