This code is based on another codebase. I was just wanting to join the string template with the variable tip and I ended up finding it. Are almost the same, but it made me understand a lot about codemod.
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 watchedEpisodesNow = ( | |
media: IMedia, | |
season: ISeason, | |
episode: IEpisode, | |
watched: WatchedDocument | null, | |
sawPrevius: boolean, | |
): [IEpisode[], SeasonWatch[]] => { | |
if (!watched) { | |
// CREATE NEW WATCHED |
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 enum BulkTypes { | |
SEQUENCE = 'SEQUENCE', | |
NOT_SEQUENCE = 'NOT_SEQUENCE', | |
} | |
interface NotSequenceValue { | |
numbers: number[]; | |
type: BulkTypes.NOT_SEQUENCE; | |
} |
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
<script> | |
const a = document.querySelector("table tbody"); | |
const getPersons = async (count = 30) => { | |
const response = await fetch( | |
"https://randomuser.me/api/?results=" + count | |
); | |
const data = await response.json(); | |
return data.results.map((person) => { |
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
// Data | |
// [ | |
// { | |
// "key": 1, | |
// "seasons": [ | |
// { | |
// episodes: [ | |
// 3, | |
// 3 | |
// ] |
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 { clearDatabase, closeDatabase, connectDatabase } from '../../../../../tests/mongo'; | |
import { mutate } from '../../../../../tests/app'; | |
import { createUserFixture } from '../../../../../tests/user.factory'; | |
import ERRORS from '../../../../errors'; | |
beforeAll(async () => await connectDatabase()); | |
beforeEach(async () => { | |
await clearDatabase(); |
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
declare function rename< | |
P extends string, | |
P2 extends string, | |
O extends object, | |
Key extends keyof O | |
>( | |
prefix: P, | |
newPrefix: P2, | |
obj: O | |
): { |
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 const CAST_LIST_FIELDS = gql` | |
${CAST_FIELDS} | |
fragment CAST_LIST_FIELDS on Media { | |
cast(first: 10) { | |
edges { | |
node { | |
id | |
...CAST_FIELDS | |
} | |
} |
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'; | |
import { render, fireEvent, waitFor } from '@testing-library/react-native'; | |
import { LoginForm } from './LoginForm'; | |
import { withTheme } from '../../../../tests/withTheme'; | |
import { VALIDATION_ERROR_MESSAGES } from '../../../../Constants'; | |
jest.mock('@expo/vector-icons', () => ({ | |
Ionicons: '', | |
AntDesign: '', | |
})); |
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
/** | |
* Paste or drop some JavaScript here and explore | |
* the syntax tree created by chosen parser. | |
* You can use all the cool new features from ES6 | |
* and even more. Enjoy! | |
*/ | |
const name = 1 | |
const description = 'Yo ' + name + '! How are you doing? ' + 1 |