From d05aa163952ea97ff81a395a4371043447ee68e2 Mon Sep 17 00:00:00 2001 From: Mariana Stamatakis Trevisani Date: Wed, 2 Feb 2022 17:58:58 -0300 Subject: [PATCH 1/9] =?UTF-8?q?Aula42-exerc=C3=ADcios?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../aula-42/{ => aula-42}/src/Exercicio1.ts | 0 .../aula-42/{ => aula-42}/src/Exercicio2.ts | 0 semana-15/aula-42/{ => aula-42}/tsconfig.json | 0 .../FIRST-SCRIPT/package-lock.json" | 5 + .../FIRST-SCRIPT/package.json" | 12 +++ .../FIRST-SCRIPT/src/index.ts" | 98 +++++++++++++++++++ .../FIRST-SCRIPT/tsconfig.json" | 11 +++ 7 files changed, 126 insertions(+) rename semana-15/aula-42/{ => aula-42}/src/Exercicio1.ts (100%) rename semana-15/aula-42/{ => aula-42}/src/Exercicio2.ts (100%) rename semana-15/aula-42/{ => aula-42}/tsconfig.json (100%) create mode 100644 "semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package-lock.json" create mode 100644 "semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package.json" create mode 100644 "semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/src/index.ts" create mode 100644 "semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/tsconfig.json" diff --git a/semana-15/aula-42/src/Exercicio1.ts b/semana-15/aula-42/aula-42/src/Exercicio1.ts similarity index 100% rename from semana-15/aula-42/src/Exercicio1.ts rename to semana-15/aula-42/aula-42/src/Exercicio1.ts diff --git a/semana-15/aula-42/src/Exercicio2.ts b/semana-15/aula-42/aula-42/src/Exercicio2.ts similarity index 100% rename from semana-15/aula-42/src/Exercicio2.ts rename to semana-15/aula-42/aula-42/src/Exercicio2.ts diff --git a/semana-15/aula-42/tsconfig.json b/semana-15/aula-42/aula-42/tsconfig.json similarity index 100% rename from semana-15/aula-42/tsconfig.json rename to semana-15/aula-42/aula-42/tsconfig.json diff --git "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package-lock.json" "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package-lock.json" new file mode 100644 index 0000000..94e5e45 --- /dev/null +++ "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package-lock.json" @@ -0,0 +1,5 @@ +{ + "name": "FIRST-SCRIPT", + "version": "1.0.0", + "lockfileVersion": 1 +} diff --git "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package.json" "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package.json" new file mode 100644 index 0000000..ec396c4 --- /dev/null +++ "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package.json" @@ -0,0 +1,12 @@ +{ + "name": "FIRST-SCRIPT", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC" +} diff --git "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/src/index.ts" "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/src/index.ts" new file mode 100644 index 0000000..ab55e1f --- /dev/null +++ "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/src/index.ts" @@ -0,0 +1,98 @@ +type User = { + name: string, + age:number +} + +console.log("hello World") + +//Declarando variáveis em ts + +const company: string = "Labenu" +let age: number = 5 +let passwordIsCorrect: boolean = false + +//Utilizando union type (mais de uma tipagem) + +let text: string | undefined = "Mariana" +let message: string | null = null +let nickname: string|boolean = "" + +//declarando array + +const userIds: number[] = [0,1,2,3] //opção 1 +const clientIds: Array = [0,1,2,3] //opção 2 + +//declarando array com union type + +const phrase1: (string|number)[]= ["o","i","!",6] //opção 1 +const phrase2: Array = ["o","i",1,5] //opção 2 + +// declarando objetos + +const user:{name: string, age: number} = { + name: "Astrodev", + age: 500 +} + +// declarando objetos usando o type + +const user1:User = { + name: "astrodev", + age:12 +} + + +// exercício 1 + +type Carro = { + marca: string, + volumeDoTanque: number, + temMotorFlex: boolean +} + +const mustang: Carro = { + marca: "Ford", + volumeDoTanque: 61, + temMotorFlex: false +} + +const gol: Carro = { + marca: "Volkswagen", + volumeDoTanque: 55, + temMotorFlex: true +} + +const uno: Carro ={ + marca: "Fiat", + volumeDoTanque: 45, + temMotorFlex: false +} + +const automoveis: Carro[] = [] + +automoveis.push(gol) +automoveis.push(uno) +automoveis.push(mustang) +automoveis.push({marca: "Fiat", volumeDoTanque:55, temMotorFlex: true}) + +console.log(automoveis) + +// tipagem função + +const buscarCarrosPorMarca = ( + frota: Carro[], + marca?:String +): Carro[] => { + if (marca === undefined){ + return frota + } + + return frota.filter( + (carro)=>{ + return carro.marca === marca + } + ) +} + +console.log(buscarCarrosPorMarca(automoveis,"Volkswagen")) + diff --git "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/tsconfig.json" "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/tsconfig.json" new file mode 100644 index 0000000..c52e528 --- /dev/null +++ "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/tsconfig.json" @@ -0,0 +1,11 @@ +{ + "compilerOptions": { + "target": "ES6", + "module": "commonjs", + "sourceMap": true, + "outDir":"./build", + "rootDir":"./src", + "removeComments": true, + "noImplicitAny": true, + } +} From 5e704090f22788434704d653fe6bb41ba0ba0441 Mon Sep 17 00:00:00 2001 From: Mariana Stamatakis Trevisani Date: Fri, 11 Feb 2022 13:07:52 -0300 Subject: [PATCH 2/9] =?UTF-8?q?Exerc=C3=ADcios=20aula=2024?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Labefy.postman_collection.json" | 341 ++++++++++++++++++ 1 file changed, 341 insertions(+) create mode 100644 "semana-7/Aula-24-Refor\303\247o/Labefy.postman_collection.json" diff --git "a/semana-7/Aula-24-Refor\303\247o/Labefy.postman_collection.json" "b/semana-7/Aula-24-Refor\303\247o/Labefy.postman_collection.json" new file mode 100644 index 0000000..2624fda --- /dev/null +++ "b/semana-7/Aula-24-Refor\303\247o/Labefy.postman_collection.json" @@ -0,0 +1,341 @@ +{ + "info": { + "_postman_id": "d5c83294-b088-41d4-b9e9-40f8f7c9ee69", + "name": "Labefy", + "description": "## Descrição\n
Esta API gerencia playlists e músicas.\n```\n\tFeito pela Labenu. Todos os direitos reservados\n```\n\n## Instruções gerais.\n\n**Autenticação**\n\nToda requisição deve ter uma identificação de quem está fazendo a requisição. Ela deve ser enviada por meio do header `Authorization`, da seguinte forma:\n\n`Authorization: \"nome-sobrenome-turma\"`\n\nPor exemplo, se meu nome é Bob Marley e eu sou da turma Newton, o header deve ser:\n\n`Authorization: \"bob-marley-newton\"`", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "item": [ + { + "name": "searchPlaylist", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/search?name=string", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + "search" + ], + "query": [ + { + "key": "name", + "value": "string" + } + ] + }, + "description": "### Descrição:\nEssa requisição parmite pesquisar por uma playlist, usando o nome dela ou parte dele.\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Query String**\n
`name`: nome da playlist ou parte dele (obrigatório)\n```\n\tname:\"string\" \n```\n\n### Output:\n**Body**\n
`quantity`: quantidade de playlists encontradas\n
`list`: array com as playlists\n
`id`: id de cada playlist\n
`name`: nome de cada playlist\n```\n{\n \"result\": {\n \t\"quantity\": \"number\", \n \"list\": [\n {\n \"id\": \"string\", \n \"name\": \"string\" \n }\n ]\n }\n}\n```\n\n\n\n" + }, + "response": [] + }, + { + "name": "getAllPlaylists", + "protocolProfileBehavior": { + "disabledSystemHeaders": {} + }, + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "value": "Mariana-Stamatakis-Maryam", + "type": "default" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists" + ] + } + }, + "response": [] + }, + { + "name": "getPlaylistTracks", + "request": { + "method": "GET", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Mariana-Stamatakis-Maryam" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/:playlistId/tracks", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + ":playlistId", + "tracks" + ], + "variable": [ + { + "key": "playlistId", + "value": "201caaf4-42bd-4b79-97f1-963bccc1be0a" + } + ] + }, + "description": "### Descrição:\nEsta requisição permite verificar quais músicas estão em uma determinada playlist\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Path Param**\n
`playlistId`: id da playlist (obrigatório)\n\n### Output:\n**Body**\n
`quantity`: quantidade de músicas da playlist\n
`tracks`: array com as informações das músicas\n
`id`: id de cada música\n
`name`: nome de cada música\n
`artist`: cantor ou band da música\n
`url`: URL da música para ser tocada\n```\n{\n \"result\": {\n \"quantity\": \"number\",\n \"tracks\": [ \n {\n \"id\": \"string\", \n \"name\": \"string\", \n \"artist\": \"string\",\n \"url\": \"string\"\n }\n ]\n }\n}\n```\n\n" + }, + "response": [] + }, + { + "name": "createPlaylist", + "request": { + "auth": { + "type": "noauth" + }, + "method": "POST", + "header": [ + { + "key": "Authorization", + "value": "Mariana-Stamatakis-Maryam", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"Pop Internacional\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists?name=Pop Internacional", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists" + ], + "query": [ + { + "key": "name", + "value": "Pop Internacional" + } + ] + }, + "description": "### Descrição:\nEssa requisição cria uma nova playlist. \n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n**Body**\n
`name`: nome da playlist (obrigatório)\n```\n{\n\t\"name\": \"string\" \n}\n```" + }, + "response": [ + { + "name": "createPlaylist", + "originalRequest": { + "method": "POST", + "header": [ + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + }, + { + "key": "auth", + "value": "authentication-token", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"playlist-name\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{baseUrl}}/playlists/createPlaylist", + "host": [ + "{{baseUrl}}" + ], + "path": [ + "playlists", + "createPlaylist" + ] + } + }, + "_postman_previewlanguage": "Text", + "header": [], + "cookie": [], + "body": "" + } + ] + }, + { + "name": "addTrackToPlaylist", + "request": { + "method": "POST", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "Mariana-Stamatakis-Maryam" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"name\": \"Titanium ft. Sia\",\n\t\"artist\": \"David Guetta\",\n\t\"url\": \"https://www.youtube.com/watch?v=JRfuAukYTKg&ab_channel=DavidGuetta\"\n}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/:playlistId/tracks", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + ":playlistId", + "tracks" + ], + "variable": [ + { + "key": "playlistId", + "value": "201caaf4-42bd-4b79-97f1-963bccc1be0a" + } + ] + }, + "description": "### Descrição:\nEssa requisição adiciona uma música a uma playlist existente\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Path Param**\n
`playlistId`: id da playlist (obrigatório)\n\n**Body**\n
`name`: nome da música (obrigatório)\n
`artist`: cantor ou banda da música (obrigatório)\n
`url`: URL da música para ser tocada (obrigatório)\n```\n{\n\t\"name\": \"string\", \n\t\"artist\": \"string\",\n\t\"url\": \"string\"\n}\n```\n\n\n" + }, + "response": [] + }, + { + "name": "deletePlaylist", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/:playlistId", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + ":playlistId" + ], + "variable": [ + { + "key": "playlistId", + "value": "247e3159-ac9f-491e-8eac-3ee4027681d8" + } + ] + }, + "description": "### Descrição:\nEsta requisição serve para deletar alguma playlist.\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Path Param**\n
`playlistId`: id da playlist (obrigatório)\n\n" + }, + "response": [] + }, + { + "name": "removeTrackFromPlaylist", + "request": { + "method": "DELETE", + "header": [ + { + "key": "Authorization", + "type": "text", + "value": "" + } + ], + "url": { + "raw": "https://us-central1-labenu-apis.cloudfunctions.net/labefy/playlists/:playlistId/tracks/:trackId", + "protocol": "https", + "host": [ + "us-central1-labenu-apis", + "cloudfunctions", + "net" + ], + "path": [ + "labefy", + "playlists", + ":playlistId", + "tracks", + ":trackId" + ], + "variable": [ + { + "key": "playlistId", + "value": "" + }, + { + "key": "trackId", + "value": "" + } + ] + }, + "description": "### Descrição:\nEsta requisição serve para deletar alguma música de alguma playlist\n\n### Input:\n**Headers**\n
`Authorization`: token de autenticação da API\n```\n\tAuthorization: \"nome-sobrenome-turma\"\n```\n\n**Path Params**\n
`playlistId`: id da playlist (obrigatório)\n
`trackId`: id da música (obrigatório)\n" + }, + "response": [] + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "" + ] + } + } + ] +} \ No newline at end of file From f06d25a4464799af8cf2caed83a69519445d7d15 Mon Sep 17 00:00:00 2001 From: Mariana Stamatakis Trevisani <88324978+MarianaStamatakis@users.noreply.github.com> Date: Fri, 11 Feb 2022 13:13:45 -0300 Subject: [PATCH 3/9] Delete Exercicio1.ts --- semana-15/aula-42/aula-42/src/Exercicio1.ts | 45 --------------------- 1 file changed, 45 deletions(-) delete mode 100644 semana-15/aula-42/aula-42/src/Exercicio1.ts diff --git a/semana-15/aula-42/aula-42/src/Exercicio1.ts b/semana-15/aula-42/aula-42/src/Exercicio1.ts deleted file mode 100644 index c25d3bc..0000000 --- a/semana-15/aula-42/aula-42/src/Exercicio1.ts +++ /dev/null @@ -1,45 +0,0 @@ -//a) Quando atribuido um numero mostra o erro de tipo, o valor da minha variavel precisa ser uma string -//let minhaString: string = 5 - -//b) Para a variável aceitar mais de uma tipagem podemos utilizar o "|". - -let meuNumero: number | string = "Dois" -//let meuNumero: number = 2 - -//c) e d) -enum CorArcoIris { - VIOLETA = "Violeta", - ANIL = "Anil", - AZUL = "Azul", - VERDE = "Verde", - AMARELO = "Amarelo", - LARANJA = "Laranja", - VERMELHO = "Vermelho" -} - -type Pessoa = { - nome: string - idade: number - corFavorita: CorArcoIris -} - -const mariana: Pessoa = { - nome: "Mariana", - idade: 33, - corFavorita: CorArcoIris.VIOLETA -} -const lucas: Pessoa = { - nome: "lucas", - idade: 30, - corFavorita: CorArcoIris.ANIL -} -const ana: Pessoa = { - nome: "Ana", - idade: 25, - corFavorita: CorArcoIris.VERDE -} -const pedro: Pessoa = { - nome: "Pedro", - idade: 40, - corFavorita: CorArcoIris.LARANJA -} From 23ef277d31233cfeb1098d4c32e8a609162af747 Mon Sep 17 00:00:00 2001 From: Mariana Stamatakis Trevisani <88324978+MarianaStamatakis@users.noreply.github.com> Date: Fri, 11 Feb 2022 13:14:04 -0300 Subject: [PATCH 4/9] Delete package.json --- .../exerc\303\255cio-aula/FIRST-SCRIPT/package.json" | 12 ------------ 1 file changed, 12 deletions(-) delete mode 100644 "semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package.json" diff --git "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package.json" "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package.json" deleted file mode 100644 index ec396c4..0000000 --- "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package.json" +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "FIRST-SCRIPT", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "keywords": [], - "author": "", - "license": "ISC" -} From 208b6d7fe674b089ed34f3c882387314ea269222 Mon Sep 17 00:00:00 2001 From: Mariana Stamatakis Trevisani <88324978+MarianaStamatakis@users.noreply.github.com> Date: Fri, 11 Feb 2022 13:14:22 -0300 Subject: [PATCH 5/9] Delete tsconfig.json --- .../exerc\303\255cio-aula/FIRST-SCRIPT/tsconfig.json" | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 "semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/tsconfig.json" diff --git "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/tsconfig.json" "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/tsconfig.json" deleted file mode 100644 index c52e528..0000000 --- "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/tsconfig.json" +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "target": "ES6", - "module": "commonjs", - "sourceMap": true, - "outDir":"./build", - "rootDir":"./src", - "removeComments": true, - "noImplicitAny": true, - } -} From 927504186402ac7dc753573013701865e6e880bf Mon Sep 17 00:00:00 2001 From: Mariana Stamatakis Trevisani <88324978+MarianaStamatakis@users.noreply.github.com> Date: Fri, 11 Feb 2022 13:15:02 -0300 Subject: [PATCH 6/9] Delete index.ts --- .../FIRST-SCRIPT/src/index.ts" | 98 ------------------- 1 file changed, 98 deletions(-) delete mode 100644 "semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/src/index.ts" diff --git "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/src/index.ts" "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/src/index.ts" deleted file mode 100644 index ab55e1f..0000000 --- "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/src/index.ts" +++ /dev/null @@ -1,98 +0,0 @@ -type User = { - name: string, - age:number -} - -console.log("hello World") - -//Declarando variáveis em ts - -const company: string = "Labenu" -let age: number = 5 -let passwordIsCorrect: boolean = false - -//Utilizando union type (mais de uma tipagem) - -let text: string | undefined = "Mariana" -let message: string | null = null -let nickname: string|boolean = "" - -//declarando array - -const userIds: number[] = [0,1,2,3] //opção 1 -const clientIds: Array = [0,1,2,3] //opção 2 - -//declarando array com union type - -const phrase1: (string|number)[]= ["o","i","!",6] //opção 1 -const phrase2: Array = ["o","i",1,5] //opção 2 - -// declarando objetos - -const user:{name: string, age: number} = { - name: "Astrodev", - age: 500 -} - -// declarando objetos usando o type - -const user1:User = { - name: "astrodev", - age:12 -} - - -// exercício 1 - -type Carro = { - marca: string, - volumeDoTanque: number, - temMotorFlex: boolean -} - -const mustang: Carro = { - marca: "Ford", - volumeDoTanque: 61, - temMotorFlex: false -} - -const gol: Carro = { - marca: "Volkswagen", - volumeDoTanque: 55, - temMotorFlex: true -} - -const uno: Carro ={ - marca: "Fiat", - volumeDoTanque: 45, - temMotorFlex: false -} - -const automoveis: Carro[] = [] - -automoveis.push(gol) -automoveis.push(uno) -automoveis.push(mustang) -automoveis.push({marca: "Fiat", volumeDoTanque:55, temMotorFlex: true}) - -console.log(automoveis) - -// tipagem função - -const buscarCarrosPorMarca = ( - frota: Carro[], - marca?:String -): Carro[] => { - if (marca === undefined){ - return frota - } - - return frota.filter( - (carro)=>{ - return carro.marca === marca - } - ) -} - -console.log(buscarCarrosPorMarca(automoveis,"Volkswagen")) - From 6fe1c3d7b4b2ef6e74f306bab7696584d0c4c23b Mon Sep 17 00:00:00 2001 From: Mariana Stamatakis Trevisani <88324978+MarianaStamatakis@users.noreply.github.com> Date: Fri, 11 Feb 2022 13:15:55 -0300 Subject: [PATCH 7/9] Delete package-lock.json --- .../exerc\303\255cio-aula/FIRST-SCRIPT/package-lock.json" | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 "semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package-lock.json" diff --git "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package-lock.json" "b/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package-lock.json" deleted file mode 100644 index 94e5e45..0000000 --- "a/semana-15/aula-42/exerc\303\255cio-aula/FIRST-SCRIPT/package-lock.json" +++ /dev/null @@ -1,5 +0,0 @@ -{ - "name": "FIRST-SCRIPT", - "version": "1.0.0", - "lockfileVersion": 1 -} From bb3560cfed68af145013878720ea6eda2bae3919 Mon Sep 17 00:00:00 2001 From: Mariana Stamatakis Trevisani <88324978+MarianaStamatakis@users.noreply.github.com> Date: Fri, 11 Feb 2022 13:16:22 -0300 Subject: [PATCH 8/9] Delete Exercicio2.ts --- semana-15/aula-42/aula-42/src/Exercicio2.ts | 24 --------------------- 1 file changed, 24 deletions(-) delete mode 100644 semana-15/aula-42/aula-42/src/Exercicio2.ts diff --git a/semana-15/aula-42/aula-42/src/Exercicio2.ts b/semana-15/aula-42/aula-42/src/Exercicio2.ts deleted file mode 100644 index 29c5271..0000000 --- a/semana-15/aula-42/aula-42/src/Exercicio2.ts +++ /dev/null @@ -1,24 +0,0 @@ -//a) -function obterEstatisticas(numeros:any) { - - const numerosOrdenados = numeros.sort( - (a:number, b:number) => a - b - ) - - let soma = 0 - - for (let num of numeros) { - soma += num - } - - const estatisticas = { - maior: numerosOrdenados[numeros.length - 1], - menor: numerosOrdenados[0], - media: soma / numeros.length - } - - return estatisticas -} -obterEstatisticas(45) - -//b) \ No newline at end of file From 933910792a41a4b6c7a23b78d5d2ce0c578d9361 Mon Sep 17 00:00:00 2001 From: Mariana Stamatakis Trevisani <88324978+MarianaStamatakis@users.noreply.github.com> Date: Fri, 11 Feb 2022 13:16:31 -0300 Subject: [PATCH 9/9] Delete tsconfig.json --- semana-15/aula-42/aula-42/tsconfig.json | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 semana-15/aula-42/aula-42/tsconfig.json diff --git a/semana-15/aula-42/aula-42/tsconfig.json b/semana-15/aula-42/aula-42/tsconfig.json deleted file mode 100644 index d25ba3d..0000000 --- a/semana-15/aula-42/aula-42/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "compilerOptions": { - "target": "es6", /* Specify ECMAScript target version */ - "module": "commonjs", /* Specify module code generation */ - "sourceMap": true, /* Generates corresponding '.map' file. */ - "outDir": "./build", /* Redirect output structure to the directory. */ - "rootDir": "./src", /* Specify the root directory of input files. */ - "removeComments": true, /* Do not emit comments to output. */ - "noImplicitAny": true, /* Raise error on declarations with an implied 'any' type. */ - } -} \ No newline at end of file