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
| name: Build and deploy | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| build: | |
| name: Build | |
| runs-on: ubuntu-18.04 | |
| strategy: |
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 myObj = { firstName: 'John', lastName: 'Doe' }; | |
| for (const [key, value] of Object.entries(myObj)) { | |
| console.log(`${key} ${value}`); // John Doe | |
| } |
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
| // The filter() method creates a new array filled with elements that pass a test provided by a function | |
| [1, 2, 3, 4, 5].filter((n) => n > 3); // [4,5] | |
| // The find() method returns the value of the first element that passes the test | |
| [1, 2, 3, 4, 5].find((n) => n > 3); // 4 | |
| //. The every() method tests whether all elements in the array pass the test implemented by the provided function. It returns a Boolean value. | |
| [1, 30, 39, 29, 10, 34].every((n) => n < 40); // true |
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 fs from 'fs'; | |
| import path from 'path'; | |
| export const write = ( | |
| data: string, | |
| filename: string, | |
| dir: string = process.cwd(), | |
| ): Promise<string> => | |
| new Promise((resolve, reject) => { | |
| const dest = path.resolve(`${dir}/${filename}`); |
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
| |
OlderNewer