Skip to content

Grammar Refined #81

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Jun 3, 2023
Merged
Show file tree
Hide file tree
Changes from all 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: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
github: mdevils
patreon: mdevils
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Build and Deploy
on:
push:
branches:
- main
permissions:
contents: write
jobs:
build-and-deploy:
concurrency: ci-${{ github.ref }}
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16'

- name: Install and Build 🔧
run: |
npm ci
npm run build

- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.PAGES_UPDATE_TOKEN }}
folder: build
repository-name: typescript-exercises/typescript-exercises.github.io
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Start your journey here: https://typescript-exercises.github.io/
The goal: Let everyone play with many different TypeScript features
and get an overview of TypeScript capabilities and principles.

Sponsor me: https://github.com/sponsors/mdevils

## Things to cover

1. Basic typing.
Expand All @@ -18,11 +20,11 @@ and get an overview of TypeScript capabilities and principles.

## Rules and principles

1. Avoid using `any` type at all cost.
1. Avoid using `any` type at all costs.

2. Difficulty quickly grows one exercise after another.

3. Feel free to send pull-requests if you've come up
3. Feel free to send pull requests if you've come up
with improvements!

4. Provide feedback to the creator of these exercises.
Expand Down
18,366 changes: 18,366 additions & 0 deletions package-lock.json

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,18 @@
"private": true,
"author": "Marat Dulin",
"license": "MIT",
"funding": [
{
"type": "github",
"url": "https://github.com/sponsors/mdevils"
},
{
"type": "patreon",
"url": "https://www.patreon.com/mdevils"
}
],
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.10",
"@emotion/core": "^10.0.28",
"@emotion/styled": "^10.0.27",
"@types/debounce": "^1.2.0",
Expand Down Expand Up @@ -49,12 +60,11 @@
"build": "EXTEND_ESLINT=true react-app-rewired build",
"lint": "eslint 'src/**/*.ts{,x}'",
"lint-fix": "eslint --fix 'src/**/*.ts{,x}'",
"eject": "react-app-rewired eject",
"release": "yarn build && rm -Rf release && git clone git@github.com:typescript-exercises/typescript-exercises.github.io.git release && cd release && git checkout gh-pages && rm -Rf * && cp -r ../build/* . && git add -A && git commit -m 'Update website.' && git push"
"eject": "react-app-rewired eject"
},
"husky": {
"hooks": {
"pre-commit": "yarn lint"
"pre-commit": "npm run lint"
}
},
"eslintConfig": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/footer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function Footer() {
<FooterWrapper>
&copy; {currentYear} <a href='https://github.com/mdevils'>Marat Dulin</a>,{' '}
<a href='https://github.com/typescript-exercises/typescript-exercises'>contribute</a>,{' '}
<a href='https://www.patreon.com/mdevils'>support this project</a>
<a href='https://github.com/sponsors/mdevils'>support this project</a>
</FooterWrapper>
);
}
12 changes: 5 additions & 7 deletions src/exercises/1/index.solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Welcome to:

1. Avoid using "any" type at all costs.
2. Difficulty quickly grows one exercise after another.
3. Feel free to send pull-requests if you've came up
3. Feel free to send pull requests if you've come up
with improvements!
4. Provide feedback to the creator of these exercises.
5. Enjoy.
Expand Down Expand Up @@ -63,11 +63,11 @@ Brief UI guide:
Intro:

We are starting a small community of users. For performance
reasons we have decided to store all users right in the code.
reasons, we have decided to store all users right in the code.
This way we can provide our developers with more
user-interaction opportunities. With user-related data, at least.
All the GDPR-related issues we will solved some other day.
This would be the base for our future experiments during
All the GDPR-related issues will be solved some other day.
This would be the basis for our future experiments during
these exercises.

Exercise:
Expand Down Expand Up @@ -103,7 +103,5 @@ console.log('Users:');
users.forEach(logPerson);


/* In case if you are stuck:

// In case if you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/objects.html
*/
8 changes: 3 additions & 5 deletions src/exercises/1/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Welcome to:

1. Avoid using "any" type at all costs.
2. Difficulty quickly grows one exercise after another.
3. Feel free to send pull-requests if you've come up
3. Feel free to send pull requests if you've come up
with improvements!
4. Provide feedback to the creator of these exercises.
5. Enjoy.
Expand Down Expand Up @@ -67,7 +67,7 @@ Intro:
This way we can provide our developers with more
user-interaction opportunities. With user-related data, at least.
All the GDPR-related issues will be solved some other day.
This would be the base for our future experiments during
This would be the basis for our future experiments during
these exercises.

Exercise:
Expand Down Expand Up @@ -99,7 +99,5 @@ console.log('Users:');
users.forEach(logPerson);


/* In case if you are stuck:

// In case if you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/objects.html
*/
2 changes: 1 addition & 1 deletion src/exercises/11/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@ function logPerson(person: Person) {
.concat(users, admins)
.forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules
2 changes: 1 addition & 1 deletion src/exercises/13/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@ console.log('Early birds:');
.filter((person) => dateWizard.dateDetails(person.registered).hours < 10)
.forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/modules.html#ambient-modules
// https://www.typescriptlang.org/docs/handbook/declaration-merging.html
5 changes: 4 additions & 1 deletion src/exercises/16/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@

Marat Dulin, https://mdevils.com

Support my new ideas on Patreon:
Support me on GitHub Sponsors:
https://github.com/sponsors/mdevils

Support me on Patreon:
https://www.patreon.com/mdevils
*/
4 changes: 2 additions & 2 deletions src/exercises/2/index.solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Intro:
forward and introduce some order. We are in Germany after all.
Let's add a couple of admins.

Initially we only had users in the in-memory database. After
Initially, we only had users in the in-memory database. After
introducing Admins, we need to fix the types so that
everything works well together.

Expand Down Expand Up @@ -62,4 +62,4 @@ export function logPerson(user: Person) {
persons.forEach(logPerson);

// In case if you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/types-from-types.html
// https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types
4 changes: 2 additions & 2 deletions src/exercises/2/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Intro:
forward and introduce some order. We are in Germany after all.
Let's add a couple of admins.

Initially we only had users in the in-memory database. After
Initially, we only had users in the in-memory database. After
introducing Admins, we need to fix the types so that
everything works well together.

Expand Down Expand Up @@ -62,4 +62,4 @@ export function logPerson(user: User) {
persons.forEach(logPerson);

// In case if you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/types-from-types.html
// https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#union-types
2 changes: 1 addition & 1 deletion src/exercises/4/index.solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ console.log();
console.log('Users:');
persons.filter(isUser).forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
2 changes: 1 addition & 1 deletion src/exercises/4/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,5 @@ console.log();
console.log('Users:');
persons.filter(isUser).forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates
4 changes: 2 additions & 2 deletions src/exercises/5/index.solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Exercise:

Higher difficulty bonus exercise:

Exclude "type" from filter criterias.
Exclude "type" from filter criteria.

*/

Expand Down Expand Up @@ -103,6 +103,6 @@ filterUsers(
}
).forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/utility-types.html
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#predefined-conditional-types
4 changes: 2 additions & 2 deletions src/exercises/5/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Exercise:

Higher difficulty bonus exercise:

Exclude "type" from filter criterias.
Exclude "type" from filter criteria.

*/

Expand Down Expand Up @@ -103,6 +103,6 @@ filterUsers(
}
).forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/utility-types.html
// https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html#predefined-conditional-types
2 changes: 1 addition & 1 deletion src/exercises/6/index.solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,5 @@ console.log();
console.log('Admins of age 23:');
adminsOfAge23.forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/functions.html#function-overloads
2 changes: 1 addition & 1 deletion src/exercises/6/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ console.log();
console.log('Admins of age 23:');
adminsOfAge23.forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/functions.html#function-overloads
2 changes: 1 addition & 1 deletion src/exercises/7/index.solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,5 @@ function test5() {
[test1, test2, test3, test4, test5].forEach((test) => test());

// In case if you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
// https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types
// https://www.typescriptlang.org/docs/handbook/2/generics.html
2 changes: 1 addition & 1 deletion src/exercises/7/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,5 @@ function test5() {
[test1, test2, test3, test4, test5].forEach((test) => test());

// In case if you are stuck:
// https://www.typescriptlang.org/docs/handbook/2/everyday-types.html
// https://www.typescriptlang.org/docs/handbook/2/objects.html#tuple-types
// https://www.typescriptlang.org/docs/handbook/2/generics.html
2 changes: 1 addition & 1 deletion src/exercises/8/index.solution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ console.log();
console.log('Power users:');
persons.filter(isPowerUser).forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/utility-types.html
2 changes: 1 addition & 1 deletion src/exercises/8/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,5 @@ console.log();
console.log('Power users:');
persons.filter(isPowerUser).forEach(logPerson);

// In case if you are stuck:
// In case you are stuck:
// https://www.typescriptlang.org/docs/handbook/utility-types.html
Loading
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy