Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

good#54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionREADME.md
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
<a href="https://totaltypescript.com"><img src="https://res.cloudinary.com/total-typescript/image/upload/v1662641493/beginners-typescript-tutorial/github_2x_vxqai9.png" alt="beginner typescript tutorial" /></a>
<a href="https://totaltypescript.com/tutorials/beginners-typescript"><img src="https://res.cloudinary.com/total-typescript/image/upload/v1664461034/beginners-typescript-tutorial/github_2x_himnyi.png" alt="beginner typescript tutorial" /></a>

## Quickstart

Expand Down
503 changes: 459 additions & 44 deletionspackage-lock.json
View file
Open in desktop

Large diffs are not rendered by default.

47 changes: 42 additions & 5 deletionspackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,23 +3,60 @@
"version": "1.0.0",
"main": "index.js",
"author": "Matt Pocock <mattpocockvoice@gmail.com>",
"license": "GPL",
"license": "GPL-3.0",
"devDependencies": {
"@types/node": "^18.6.5",
"chokidar": "^3.5.3",
"cross-fetch": "^3.1.5",
"typescript": "^4.8.2",
"typescript": "^4.8.3",
"vitest": "^0.21.1"
},
"scripts": {
"exercise": "node scripts/exercise.js",
"e": "npm run exercise",
"e": "yarn run exercise",
"solution": "SOLUTION=true node scripts/exercise.js",
"s": "npm run solution"
"s": "yarn run solution",
"prepare": "node scripts/prepare-stackblitz.js",
"e-01": "yarn exercise 01",
"s-01": "yarn solution 01",
"e-02": "yarn exercise 02",
"s-02": "yarn solution 02",
"e-03": "yarn exercise 03",
"s-03": "yarn solution 03",
"e-04": "yarn exercise 04",
"s-04": "yarn solution 04",
"e-05": "yarn exercise 05",
"s-05": "yarn solution 05",
"e-06": "yarn exercise 06",
"s-06": "yarn solution 06",
"e-07": "yarn exercise 07",
"s-07": "yarn solution 07",
"e-08": "yarn exercise 08",
"s-08": "yarn solution 08",
"e-09": "yarn exercise 09",
"s-09": "yarn solution 09",
"e-10": "yarn exercise 10",
"s-10": "yarn solution 10",
"e-11": "yarn exercise 11",
"s-11": "yarn solution 11",
"e-12": "yarn exercise 12",
"s-12": "yarn solution 12",
"e-13": "yarn exercise 13",
"s-13": "yarn solution 13",
"e-14": "yarn exercise 14",
"s-14": "yarn solution 14",
"e-15": "yarn exercise 15",
"s-15": "yarn solution 15",
"e-16": "yarn exercise 16",
"s-16": "yarn solution 16",
"e-17": "yarn exercise 17",
"s-17": "yarn solution 17",
"e-18": "yarn exercise 18",
"s-18": "yarn solution 18"
},
"dependencies": {
"@types/express": "^4.17.13",
"express": "^4.18.1",
"zod": "^3.17.10"
}
}
}
29 changes: 29 additions & 0 deletionsscripts/prepare-stackblitz.js
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
const fs = require("fs");
const path = require("path");

/**
* Adds a bunch of scripts, like e-01, e-02 to package.json
* so that StackBlitz can run them programmatically via URL
* commands
*/

const packageJsonPath = path.resolve(__dirname, "../package.json");
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
const exercises = fs.readdirSync(path.resolve(__dirname, "../src"));
const exerciseFiles = exercises.filter((exercise) =>
exercise.includes(".problem."),
);
const exerciseNames = exerciseFiles.map((exercise) => exercise.split("-")[0]);

const newPackageJson = Object.assign({}, packageJson);

newPackageJson.scripts = {
...packageJson.scripts,
};

exerciseNames.forEach((exercise) => {
newPackageJson.scripts[`e-${exercise}`] = `yarn exercise ${exercise}`;
newPackageJson.scripts[`s-${exercise}`] = `yarn solution ${exercise}`;
});

fs.writeFileSync(packageJsonPath, JSON.stringify(newPackageJson, null, 2));
45 changes: 0 additions & 45 deletionssrc/08-function-return-type-annotations.solution.2.ts
View file
Open in desktop

This file was deleted.

20 changes: 20 additions & 0 deletionssrc/09-promises.solution.3.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
interface LukeSkywalker {
name: string;
height: string;
mass: string;
hair_color: string;
skin_color: string;
eye_color: string;
birth_year: string;
gender: string;
}

export const fetchLukeSkywalker = async () => {
const data: LukeSkywalker = await fetch(
"https://swapi.dev/api/people/1"
).then((res) => {
return res.json();
});

return data;
};
1 change: 1 addition & 0 deletionsvite.config.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -5,5 +5,6 @@ export default defineConfig({
include: ["src/**/*.ts"],
setupFiles: ["scripts/setup.ts"],
passWithNoTests: true,
teardownTimeout: 5000,
},
});

[8]ページ先頭

©2009-2025 Movatter.jp