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.
		
		
		
		
			
				
					34 lines
				
				645 B
			
		
		
			
		
	
	
					34 lines
				
				645 B
			| 
								 
											4 years ago
										 
									 | 
							
								# is-generator-fn [](https://travis-ci.org/sindresorhus/is-generator-fn)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								> Check if something is a [generator function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/function*)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								## Install
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								```
							 | 
						||
| 
								 | 
							
								$ npm install is-generator-fn
							 | 
						||
| 
								 | 
							
								```
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								## Usage
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								```js
							 | 
						||
| 
								 | 
							
								const isGeneratorFn = require('is-generator-fn');
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								isGeneratorFn(function * () {});
							 | 
						||
| 
								 | 
							
								//=> true
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								isGeneratorFn(function () {});
							 | 
						||
| 
								 | 
							
								//=> false
							 | 
						||
| 
								 | 
							
								```
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								## Related
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								- [is](https://github.com/sindresorhus/is) - Type check values
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								## License
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								MIT © [Sindre Sorhus](https://sindresorhus.com)
							 |