Skip to content
Open
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
38 changes: 19 additions & 19 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
indent_size = 2
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[node_modules/**]
charset = unset
indent_size = unset
end_of_line = unset
indent_style = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
indent_size = 2
end_of_line = lf
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
[node_modules/**]
charset = unset
indent_size = unset
end_of_line = unset
indent_style = unset
insert_final_newline = unset
trim_trailing_whitespace = unset
54 changes: 27 additions & 27 deletions .github/workflows/challenge.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
name: Challenges

on: pull_request

jobs:
server:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]

steps:
- uses: actions/checkout@v3

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"

- run: npm ci
- name: Run Server tests
run: npm test

env:
CI: true
name: Challenges
on: pull_request
jobs:
server:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: "npm"
- run: npm ci
- name: Run Server tests
run: npm test
env:
CI: true
40 changes: 20 additions & 20 deletions .github/workflows/fork.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
name: create-branch

on: fork

jobs:
build:
name: Create Branch
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const creator = context.actor
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/heads/${creator}`,
sha: process.env.GITHUB_SHA
})
name: create-branch
on: fork
jobs:
build:
name: Create Branch
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v6
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const creator = context.actor
await github.rest.git.createRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `refs/heads/${creator}`,
sha: process.env.GITHUB_SHA
})
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node_modules
node_modules
16 changes: 8 additions & 8 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

echo "Checking for changes to tests or package.json..."
echo "Do not make any changes to tests or package.json."

git diff --quiet src/**/test.js
git diff --quiet package.json
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
echo "Checking for changes to tests or package.json..."
echo "Do not make any changes to tests or package.json."
git diff --quiet src/**/test.js
git diff --quiet package.json
30 changes: 15 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Instruction

[![Github Workflow](https://github.com/decadevs/mini-challenges-1/workflows/create-branch/badge.svg)](https://github.com/decadevs/mini-challenges-1/actions)

- Fork this Repo.
- Open the src folder
- View the Readme.md for each challenge in its folder
- Solve all the problems in its corresponding index file.
- Submit a PR against your branch name i.e Make sure your name and the target branch matches

![PR](./PR.png)

> **Note**
> You can rename any of the `index.js` files to `index.ts` to solve the problem using typescript.
> You would be required to write the correct function signatures for the functions though.
# Instruction
[![Github Workflow](https://github.com/decadevs/mini-challenges-1/workflows/create-branch/badge.svg)](https://github.com/decadevs/mini-challenges-1/actions)
- Fork this Repo.
- Open the src folder
- View the Readme.md for each challenge in its folder
- Solve all the problems in its corresponding index file.
- Submit a PR against your branch name i.e Make sure your name and the target branch matches
![PR](./PR.png)
> **Note**
> You can rename any of the `index.js` files to `index.ts` to solve the problem using typescript.
> You would be required to write the correct function signatures for the functions though.
10 changes: 5 additions & 5 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: "ts-jest/presets/js-with-ts",
testEnvironment: "node",
};
/** @type {import('ts-jest/dist/types').InitialOptionsTsJest} */
module.exports = {
preset: "ts-jest/presets/js-with-ts",
testEnvironment: "node",
};
Loading