add hw2
This commit is contained in:
		
							
								
								
									
										5
									
								
								node_modules/@iconify/utils/lib/customisations/bool.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								node_modules/@iconify/utils/lib/customisations/bool.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| /** | ||||
|  * Get boolean customisation value from attribute | ||||
|  */ | ||||
| declare function toBoolean(name: string, value: unknown, defaultValue: boolean): boolean; | ||||
| export { toBoolean }; | ||||
							
								
								
									
										20
									
								
								node_modules/@iconify/utils/lib/customisations/bool.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								node_modules/@iconify/utils/lib/customisations/bool.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| /** | ||||
| * Get boolean customisation value from attribute | ||||
| */ | ||||
| function toBoolean(name, value, defaultValue) { | ||||
| 	switch (typeof value) { | ||||
| 		case "boolean": return value; | ||||
| 		case "number": return !!value; | ||||
| 		case "string": switch (value.toLowerCase()) { | ||||
| 			case "1": | ||||
| 			case "true": | ||||
| 			case name.toLowerCase(): return true; | ||||
| 			case "0": | ||||
| 			case "false": | ||||
| 			case "": return false; | ||||
| 		} | ||||
| 	} | ||||
| 	return defaultValue; | ||||
| } | ||||
|  | ||||
| export { toBoolean }; | ||||
							
								
								
									
										23
									
								
								node_modules/@iconify/utils/lib/customisations/defaults.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								node_modules/@iconify/utils/lib/customisations/defaults.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,23 @@ | ||||
| import { IconifyTransformations } from "@iconify/types"; | ||||
| /** | ||||
|  * Icon size | ||||
|  */ | ||||
| type IconifyIconSize = null | string | number; | ||||
| /** | ||||
|  * Dimensions | ||||
|  */ | ||||
| interface IconifyIconSizeCustomisations { | ||||
|   width?: IconifyIconSize; | ||||
|   height?: IconifyIconSize; | ||||
| } | ||||
| /** | ||||
|  * Icon customisations | ||||
|  */ | ||||
| interface IconifyIconCustomisations extends IconifyTransformations, IconifyIconSizeCustomisations {} | ||||
| type FullIconCustomisations = Required<IconifyIconCustomisations>; | ||||
| /** | ||||
|  * Default icon customisations values | ||||
|  */ | ||||
| declare const defaultIconSizeCustomisations: Required<IconifyIconSizeCustomisations>; | ||||
| declare const defaultIconCustomisations: FullIconCustomisations; | ||||
| export { FullIconCustomisations, IconifyIconCustomisations, IconifyIconSize, IconifyIconSizeCustomisations, defaultIconCustomisations, defaultIconSizeCustomisations }; | ||||
							
								
								
									
										15
									
								
								node_modules/@iconify/utils/lib/customisations/defaults.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								node_modules/@iconify/utils/lib/customisations/defaults.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,15 @@ | ||||
| import { defaultIconTransformations } from "../icon/defaults.js"; | ||||
|  | ||||
| /** | ||||
| * Default icon customisations values | ||||
| */ | ||||
| const defaultIconSizeCustomisations = Object.freeze({ | ||||
| 	width: null, | ||||
| 	height: null | ||||
| }); | ||||
| const defaultIconCustomisations = Object.freeze({ | ||||
| 	...defaultIconSizeCustomisations, | ||||
| 	...defaultIconTransformations | ||||
| }); | ||||
|  | ||||
| export { defaultIconCustomisations, defaultIconSizeCustomisations }; | ||||
							
								
								
									
										12
									
								
								node_modules/@iconify/utils/lib/customisations/flip.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								node_modules/@iconify/utils/lib/customisations/flip.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,12 @@ | ||||
| import { IconifyIconCustomisations } from "./defaults.js"; | ||||
| /** | ||||
|  * Additional shorthand customisations | ||||
|  */ | ||||
| interface ShorthandIconCustomisations { | ||||
|   flip?: string; | ||||
| } | ||||
| /** | ||||
|  * Apply "flip" string to icon customisations | ||||
|  */ | ||||
| declare function flipFromString(custom: IconifyIconCustomisations, flip: string): void; | ||||
| export { ShorthandIconCustomisations, flipFromString }; | ||||
							
								
								
									
										19
									
								
								node_modules/@iconify/utils/lib/customisations/flip.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										19
									
								
								node_modules/@iconify/utils/lib/customisations/flip.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,19 @@ | ||||
| const separator = /[\s,]+/; | ||||
| /** | ||||
| * Apply "flip" string to icon customisations | ||||
| */ | ||||
| function flipFromString(custom, flip) { | ||||
| 	flip.split(separator).forEach((str) => { | ||||
| 		const value = str.trim(); | ||||
| 		switch (value) { | ||||
| 			case "horizontal": | ||||
| 				custom.hFlip = true; | ||||
| 				break; | ||||
| 			case "vertical": | ||||
| 				custom.vFlip = true; | ||||
| 				break; | ||||
| 		} | ||||
| 	}); | ||||
| } | ||||
|  | ||||
| export { flipFromString }; | ||||
							
								
								
									
										6
									
								
								node_modules/@iconify/utils/lib/customisations/merge.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								node_modules/@iconify/utils/lib/customisations/merge.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,6 @@ | ||||
| import { FullIconCustomisations, IconifyIconCustomisations } from "./defaults.js"; | ||||
| /** | ||||
|  * Convert IconifyIconCustomisations to FullIconCustomisations, checking value types | ||||
|  */ | ||||
| declare function mergeCustomisations<T extends FullIconCustomisations>(defaults: T, item: IconifyIconCustomisations): T; | ||||
| export { mergeCustomisations }; | ||||
							
								
								
									
										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 }; | ||||
							
								
								
									
										5
									
								
								node_modules/@iconify/utils/lib/customisations/rotate.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								node_modules/@iconify/utils/lib/customisations/rotate.d.ts
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,5 @@ | ||||
| /** | ||||
|  * Get rotation value | ||||
|  */ | ||||
| declare function rotateFromString(value: string, defaultValue?: number): number; | ||||
| export { rotateFromString }; | ||||
							
								
								
									
										31
									
								
								node_modules/@iconify/utils/lib/customisations/rotate.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								node_modules/@iconify/utils/lib/customisations/rotate.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| /** | ||||
| * Get rotation value | ||||
| */ | ||||
| function rotateFromString(value, defaultValue = 0) { | ||||
| 	const units = value.replace(/^-?[0-9.]*/, ""); | ||||
| 	function cleanup(value$1) { | ||||
| 		while (value$1 < 0) value$1 += 4; | ||||
| 		return value$1 % 4; | ||||
| 	} | ||||
| 	if (units === "") { | ||||
| 		const num = parseInt(value); | ||||
| 		return isNaN(num) ? 0 : cleanup(num); | ||||
| 	} else if (units !== value) { | ||||
| 		let split = 0; | ||||
| 		switch (units) { | ||||
| 			case "%": | ||||
| 				split = 25; | ||||
| 				break; | ||||
| 			case "deg": split = 90; | ||||
| 		} | ||||
| 		if (split) { | ||||
| 			let num = parseFloat(value.slice(0, value.length - units.length)); | ||||
| 			if (isNaN(num)) return 0; | ||||
| 			num = num / split; | ||||
| 			return num % 1 === 0 ? cleanup(num) : 0; | ||||
| 		} | ||||
| 	} | ||||
| 	return defaultValue; | ||||
| } | ||||
|  | ||||
| export { rotateFromString }; | ||||
		Reference in New Issue
	
	Block a user
	 nik
					nik