 c177363a19
			
		
	
	c177363a19
	
	
	
		
			
			🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
		
			
				
	
	
		
			19 lines
		
	
	
		
			331 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			331 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
| 'use strict'
 | |
| 
 | |
| const SemVer = require('../classes/semver')
 | |
| const parse = (version, options, throwErrors = false) => {
 | |
|   if (version instanceof SemVer) {
 | |
|     return version
 | |
|   }
 | |
|   try {
 | |
|     return new SemVer(version, options)
 | |
|   } catch (er) {
 | |
|     if (!throwErrors) {
 | |
|       return null
 | |
|     }
 | |
|     throw er
 | |
|   }
 | |
| }
 | |
| 
 | |
| module.exports = parse
 |