docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
Build a utility that analyzes user agent strings and generates formatted reports about operating system information, with a focus on providing human-readable version names.
Create a module that provides OS detection and reporting functionality:
The OS report should be a plain text string with the following format for each user agent:
OS: [name] | Version: [version] | Name: [versionName or "N/A"]If version name is not available, display "N/A".
/**
* Analyzes a user agent string and returns formatted OS information.
*
* @param {string} userAgent - The user agent string to analyze
* @returns {string} Formatted OS information string
*/
function getOSReport(userAgent) {
// IMPLEMENTATION HERE
}
/**
* Analyzes multiple user agent strings and returns a consolidated report.
*
* @param {string[]} userAgents - Array of user agent strings to analyze
* @returns {string} Multi-line report with one line per user agent
*/
function getBatchOSReport(userAgents) {
// IMPLEMENTATION HERE
}
module.exports = {
getOSReport,
getBatchOSReport
};Provides user agent parsing and OS detection capabilities.