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.
		
		
		
		
		
			
		
			
				
					24 lines
				
				454 B
			
		
		
			
		
	
	
					24 lines
				
				454 B
			| 
											3 years ago
										 | "use strict"; | ||
|  | 
 | ||
|  | Object.defineProperty(exports, "__esModule", { | ||
|  |   value: true | ||
|  | }); | ||
|  | exports.convertParam = void 0; | ||
|  | 
 | ||
|  | const convertParam = (value, propertyType) => { | ||
|  |   if (propertyType === 'number') { | ||
|  |     return Number(value); | ||
|  |   } | ||
|  | 
 | ||
|  |   if (propertyType === 'boolean') { | ||
|  |     return Boolean(value); | ||
|  |   } | ||
|  | 
 | ||
|  |   if (['datetime', 'date'].includes(propertyType) && value !== null) { | ||
|  |     return new Date(value); | ||
|  |   } | ||
|  | 
 | ||
|  |   return value; | ||
|  | }; | ||
|  | 
 | ||
|  | exports.convertParam = convertParam; |