File tree Expand file tree Collapse file tree 2 files changed +29
-5
lines changed
Expand file tree Collapse file tree 2 files changed +29
-5
lines changed Original file line number Diff line number Diff line change 1717 workflow_dispatch :
1818
1919jobs :
20+ lint :
21+ runs-on : ubuntu-latest
22+
23+ steps :
24+ - name : Clone repo
25+ uses : actions/checkout@v4
26+
27+ - name : Install NodeJS
28+ uses : actions/setup-node@v4
29+ with :
30+ node-version : 22.12.0
31+
32+ - name : Cache npm dependencies
33+ uses : actions/cache@v4
34+ with :
35+ path : ~/.npm
36+ key : ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
37+
38+ - name : Install dependencies
39+ run : npm ci
40+
41+ - name : Run linter
42+ run : npm run lint
43+
2044 test :
2145 runs-on : ubuntu-latest
2246
Original file line number Diff line number Diff line change 11/**
2- * @param { number } a
3- * @param {number } b
4- * @returns {number }
2+ * Add any number of arguments
3+ * @param {... number } args - The numbers to be added
4+ * @returns {number } - sum of the numbers
55 */
6- export function add ( a , b ) {
7- return a + b ;
6+ export function add ( ... args ) {
7+ return args . reduce ( ( prev , curr ) => prev + curr , 0 ) ;
88}
You can’t perform that action at this time.
0 commit comments