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
| import { | |
| Resvg | |
| } from '@resvg/resvg-js'; | |
| import { | |
| NextResponse | |
| } from 'next/server'; | |
| import satori, { | |
| SatoriOptions | |
| } from 'satori'; |
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
| import React from 'react'; | |
| export const Ticket = () => { | |
| return ( | |
| <div style={styles.container}> | |
| <svg width="100%" height="300" style={styles.svg}> | |
| <defs> | |
| <linearGradient id="shine" x1="0%" y1="0%" x2="100%" y2="100%"> | |
| <stop offset="0%" stopColor="#ff0080" /> | |
| <stop offset="20%" stopColor="#ff00ff" /> |
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
| export type Camelize<GenericObject> = { | |
| [ObjectProperty in keyof GenericObject as CamelizeString<ObjectProperty & string>]: | |
| GenericObject[ObjectProperty] extends Array<infer ArrayItem> | |
| ? ArrayItem extends Record<string, unknown> | |
| ? Array<Camelize<ArrayItem>> | |
| : GenericObject[ObjectProperty] | |
| : GenericObject[ObjectProperty] extends Record<string, unknown> | |
| ? Camelize<GenericObject[ObjectProperty]> | |
| : GenericObject[ObjectProperty]; | |
| }; |
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
| export type CamelizeString<ObjectProperty extends string> = | |
| ObjectProperty extends `${infer F}_${infer R}` | |
| ? `${F}${Capitalize<CamelizeString<R>>}` | |
| : ObjectProperty; |
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
| export type CamelizeString<ObjectProperty extends string> = | |
| ObjectProperty extends `${infer F}_${infer R}` | |
| ? `${F}${Capitalize<CamelizeString<R>>}` | |
| : ObjectProperty; | |
| export type Camelize<GenericObject> = { | |
| [ObjectProperty in keyof GenericObject as CamelizeString<ObjectProperty & string>]: | |
| GenericObject[ObjectProperty] extends Array<infer ArrayItem> | |
| ? ArrayItem extends Record<string, unknown> | |
| ? Array<Camelize<ArrayItem>> |
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
| .image-gallery { | |
| display: grid; | |
| grid-gap: 5px; | |
| } | |
| .image-gallery img { | |
| height: 250px; | |
| width: 250px; | |
| } |
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
| describe('fb social login', () => { | |
| it('should be able to login with fb', () => { | |
| cy.visit('http://localhost:3000'); | |
| return cy.loginByFacebook().then(() => { | |
| cy.get('[data-testid="fb-login-button"]') | |
| .should('be.enabled') | |
| .click(); | |
| cy.location('pathname').should('eq', '/home'); | |
| }); |
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
| Cypress.Commands.add('loginByFacebook', ( | |
| status: 'connected' | 'not_authorized' | 'unknown' = 'connected' | |
| ) => { | |
| return cy.window().then((win) => { | |
| const callbackResult = { | |
| ...status === 'connected' && { | |
| status: 'connected', | |
| authResponse: { | |
| accessToken: 'test_fbAccessToken', | |
| }, |
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
| const person01 = { | |
| name: 'JM' | |
| }; | |
| /** | |
| * Clone/copy all the values in `person01` | |
| */ | |
| const person02 = { ...person01 }; | |
| /** |
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
| let person01 = 'JM'; | |
| let person02 = person01; | |
| person02 = 'JM Santos'; | |
| console.log('person01', person01); // JM | |
| console.log('person02', person02); // JM Santos |
NewerOlder