You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					8 lines
				
				280 B
			
		
		
			
		
	
	
					8 lines
				
				280 B
			| 
								 
											3 years ago
										 
									 | 
							
								module.exports = function initBuffer(val) {
							 | 
						||
| 
								 | 
							
								  // assume old version
							 | 
						||
| 
								 | 
							
								    var nodeVersion = process && process.version ? process.version : "v5.0.0";
							 | 
						||
| 
								 | 
							
								    var major = nodeVersion.split(".")[0].replace("v", "");
							 | 
						||
| 
								 | 
							
								    return major < 6
							 | 
						||
| 
								 | 
							
								      ? new Buffer(val)
							 | 
						||
| 
								 | 
							
								      : Buffer.from(val);
							 | 
						||
| 
								 | 
							
								};
							 |