Skip to content

Commit dc643af

Browse files
committed
github action to regenerate toc
1 parent 4bf6838 commit dc643af

File tree

2 files changed

+40
-4
lines changed

2 files changed

+40
-4
lines changed

.github/workflows/gen-toc.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Generate table of contents
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
9+
env:
10+
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
11+
12+
jobs:
13+
gen-toc:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
with:
19+
ref: ${{ github.head_ref }}
20+
- name: Install dependencies
21+
run: npm install
22+
- name: Generate table of contents
23+
run: npm run gen
24+
- name: 'Commit changes if required'
25+
run: |
26+
if ! git diff --quiet README.md; then
27+
git config user.email "github-actions[bot]@users.noreply.github.com"
28+
git config user.name "GitHub Actions"
29+
git add README.md
30+
git commit -m "[auto] regenerate table of contents"
31+
git push
32+
echo "[info] Table of contents updated and committed."
33+
else
34+
echo "[info] No changes to table of contents."
35+
fi
36+
working-directory: ${{ github.workspace }}

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@
485485
| 457 | [What is the difference between map and forEach functions?](#what-is-the-difference-between-map-and-foreach-functions) |
486486
| 458 | [Give an example of statements affected by automatic semicolon insertion?](#give-an-example-of-statements-affected-by-automatic-semicolon-insertion) |
487487
| 459 | [What are the event phases on browser?](#what-are-the-event-phases-on-browser) |
488-
| 460 | [What are the real world usecases of proxy?](#what-are-the-real-world-usecases-of-proxy) |
488+
| 460 | [What are the real world use cases of proxy?](#what-are-the-real-world-use-cases-of-proxy) |
489489
<!-- TOC_END -->
490490

491491
<!-- QUESTIONS_START -->
@@ -8602,7 +8602,7 @@ Here are some common use cases of closures:
86028602
86038603
**[⬆ Back to Top](#table-of-contents)**
86048604
8605-
459. ### What are the event phases on browser?
8605+
459. ### What are the event phases of a browser?
86068606
There are 3 phases in the lifecycle of an event propagation in JavaScript,
86078607
86088608
1. **Capturing phase:** This phase goes down gradually from the top of the DOM tree to the target element when a nested element clicked. Before the click event reaching the final destination element, the click event of each parent's element must be triggered.
@@ -8617,8 +8617,8 @@ Here are some common use cases of closures:
86178617
86188618
**[⬆ Back to Top](#table-of-contents)**
86198619
8620-
460. ### What are the real world usecases of proxy?
8621-
Proxies are not used in regular day to day JavaScript work but they enabled many exciting programming patterns. Some of the real world usecases are listed below,
8620+
460. ### What are the real world use cases of proxy?
8621+
Proxies are not used in regular day to day JavaScript work but they enabled many exciting programming patterns. Some of the real world use cases are listed below,
86228622
86238623
1. Vue3 used proxy concept to implement reactive state
86248624
2. SolidJS implemented reactive stores

0 commit comments

Comments
 (0)