add hw2
This commit is contained in:
		
							
								
								
									
										18
									
								
								node_modules/@iconify/utils/lib/customisations/merge.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								node_modules/@iconify/utils/lib/customisations/merge.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| import { defaultIconSizeCustomisations } from "./defaults.js"; | ||||
|  | ||||
| /** | ||||
| * Convert IconifyIconCustomisations to FullIconCustomisations, checking value types | ||||
| */ | ||||
| function mergeCustomisations(defaults, item) { | ||||
| 	const result = { ...defaults }; | ||||
| 	for (const key in item) { | ||||
| 		const value = item[key]; | ||||
| 		const valueType = typeof value; | ||||
| 		if (key in defaultIconSizeCustomisations) { | ||||
| 			if (value === null || value && (valueType === "string" || valueType === "number")) result[key] = value; | ||||
| 		} else if (valueType === typeof result[key]) result[key] = key === "rotate" ? value % 4 : value; | ||||
| 	} | ||||
| 	return result; | ||||
| } | ||||
|  | ||||
| export { mergeCustomisations }; | ||||
		Reference in New Issue
	
	Block a user
	 nik
					nik