async function stat( path, validation, returnStats ) {
	const resolvedPath = resolve( path );
	const stats = await fsStatPromisified( resolvedPath );

	if ( validation instanceof Function && !validation( stats ) ) {
		throw new Error( "Invalid" );
	}

	return returnStats
		? stats
		: resolvedPath;
}
Asynchronously get stats of a path in the filesystem and validate it
@param {string}    path        The path
@param {Function?} validation  Validation callback. First parameter is the stats object
@param {boolean?}  returnStats Return the stats object instead of the path
@returns {Promise<(string|fs.Stats)>}