function readdirSafeSync(directoryPath) {
	try {
		return fs.readdirSync(directoryPath, { withFileTypes: true });
	} catch (error) {
		/* c8 ignore next */
		if (error.code !== "ENOENT") {
			throw error;
		}
		return [];
	}
}
Get filenames in a given path to a directory.
@param {string} directoryPath The path to target directory.
@throws {Error} As may be thrown by `fs.readdirSync`.
@returns {import("fs").Dirent[]} The filenames.
@private