- Pick an image with a 10:7 aspect ratio.
- Resize it to the Mega Drive's native resolution.
- Quantize the image to meet Mega Drive hardware limitations.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Converts an Error object into a plain object with all its properties. | |
| * It includes non-enumerable properties like "message", "name", and "stack". | |
| * | |
| * @param {Error} error - The Error object to convert. | |
| * @returns {Object} A plain object containing the properties of the Error. | |
| */ | |
| const convertErrorToPlainObject = (error) => | |
| Object.fromEntries( | |
| Object.getOwnPropertyNames(error).map((propertyName) => [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** @type {{ event: string; [key: PropertyKey]: unknown; }} */ | |
| const exampleEvent = { event: "modules_rendered", spotlight_modules: [ "ToolbarPinning", "PerformanceInterventionUI", "MobilePasswords", "129-companypayreauth", ], explore_more_modules: [ "128-company-lens", "128-product-site-search-shortcut", "127-side-panel-pinning", "125-search-box-suggestions", "125-safety-check", "123-generative-theming", ], }; | |
| console.debug( `%c DataLayer %c ${exampleEvent.event} `, "background: blue; color: white;", "background: lightgrey; color: black;", exampleEvent ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // #region Ensure CharacterData has the exact same keys as characterProperties | |
| type TypeCheck<T extends true> = T; | |
| // KeyDifference will be `never` when CharacterData's keys exactly match those | |
| // of characterPropertiesMap, otherwise it will include the mismatching keys | |
| type KeyDifference = Exclude< | |
| keyof typeof characterPropertiesMap | keyof CharacterData, | |
| keyof typeof characterPropertiesMap & keyof CharacterData | |
| >; | |
| // Typescript will throw a compile error with the mismatching keys (if any) | |
| export type AssertExactKeys = TypeCheck< |
OlderNewer