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.
		
		
		
		
		
			
		
			
				
					21 lines
				
				537 B
			
		
		
			
		
	
	
					21 lines
				
				537 B
			| 
								 
											3 years ago
										 
									 | 
							
								"use strict";
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								exports.__esModule = true;
							 | 
						||
| 
								 | 
							
								exports.default = isPlainObject;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								/**
							 | 
						||
| 
								 | 
							
								 * @param {any} obj The object to inspect.
							 | 
						||
| 
								 | 
							
								 * @returns {boolean} True if the argument appears to be a plain object.
							 | 
						||
| 
								 | 
							
								 */
							 | 
						||
| 
								 | 
							
								function isPlainObject(obj) {
							 | 
						||
| 
								 | 
							
								  if (typeof obj !== 'object' || obj === null) return false;
							 | 
						||
| 
								 | 
							
								  let proto = Object.getPrototypeOf(obj);
							 | 
						||
| 
								 | 
							
								  if (proto === null) return true;
							 | 
						||
| 
								 | 
							
								  let baseProto = proto;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  while (Object.getPrototypeOf(baseProto) !== null) {
							 | 
						||
| 
								 | 
							
								    baseProto = Object.getPrototypeOf(baseProto);
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return proto === baseProto;
							 | 
						||
| 
								 | 
							
								}
							 |