98 Commits

Author SHA1 Message Date
9010481c29 chore: update codecov-action to v4 (#1605)
The token has been added to the repository secrets.
2024-06-23 13:40:42 +02:00
cc1e1dc643 GitHub Actions: Test on the current version of Node.js (#1657) 2024-05-17 17:28:38 +02:00
6e27235fb7 Keep GitHub Actions up to date with GitHub's Dependabot
Fixes software supply chain safety warnings like at the bottom right of
https://github.com/TheAlgorithms/JavaScript/actions/runs/8960545794

* [Keeping your actions up to date with Dependabot](https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot)
* [Configuration options for the dependabot.yml file - package-ecosystem](https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem)
2024-05-16 17:05:42 +02:00
1d63400867 chore: add UploadCoverageReport.yml (#1599) 2024-01-27 22:28:12 +05:30
069803f271 style: remove trailing spaces (#1597) 2024-01-16 12:30:39 +05:30
83eb73b26f chore: update actions/checkout to v4 (#1595) 2024-01-16 00:29:53 +05:30
f0cfa8557f chore: update actions/setup-node to v4 (#1596) 2024-01-16 00:29:36 +05:30
203b7a0aa8 Properly evaluate GITHUB_ACTOR (#1594)
* fix: use `GITHUB_ACTOR` in `git config`

* Updated Documentation in README.md

---------

Co-authored-by: vil02 <vil02@users.noreply.github.com>
2024-01-13 20:55:28 +05:30
0b9fad86ba fix: CI code style checking 2023-10-28 10:53:43 +05:30
86d333ee94 feat: Test running overhaul, switch to Prettier & reformat everything (#1407)
* chore: Switch to Node 20 + Vitest

* chore: migrate to vitest mock functions

* chore: code style (switch to prettier)

* test: re-enable long-running test

Seems the switch to Node 20 and Vitest has vastly improved the code's and / or the test's runtime!

see #1193

* chore: code style

* chore: fix failing tests

* Updated Documentation in README.md

* Update contribution guidelines to state usage of Prettier

* fix: set prettier printWidth back to 80

* chore: apply updated code style automatically

* fix: set prettier line endings to lf again

* chore: apply updated code style automatically

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
2023-10-04 02:38:19 +05:30
84b01aeb61 fixed: to correct grammatical mistakes (#1307)
Corrected grammatical mistakes
2023-03-23 09:05:36 +05:30
7ea7d7b8c6 docs: improve the issue forms (#1272) 2022-12-19 21:38:51 +05:30
9d4adbb0b3 docs: add new issue templates (#1206)
* Adding new issue template

* Adding bug issue template

* Adding feature request template

* Removing feature request template and adding comments

* Converting bug template to yaml

* Adding new feature request template

* CR changes part 1

* CR changes part 2

* CR changes part 3

* CR changes part 4

* CR changes part 5

* Removing specifications section
2022-11-06 10:33:11 -06:00
16fa774012 chore: only test changed packages (#1194) 2022-10-20 15:59:09 +02:00
bd7de6a010 chore: Remove unused deps, clean up package.json a bit (#1176) 2022-10-13 17:27:05 +02:00
56713e8f43 Upgrade actions in Ci.yml workflow (#1153) 2022-10-09 17:35:06 +05:30
ad41e8cc1c fix: spellings which are making ci fail (#1089)
* Updated Documentation in README.md

* chore: remove wrong spelling

* ci: recognize "falsy" as correct spelling

* chore: fix spelling

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-09-05 11:06:24 +05:30
cbc669aa9d merge: Upgraded Algorithm of alpha numeric palindrome (#1006)
* feat: improved memoize function

used Map instead of object & used the JSON.stringfy method for generate a valid string as a key

* docs: modified documentation

* style: format with standard

* docs: modified stringify doc

* refactor: remove two repetition implementation

* feat: added validation, test codes

* chore: remove useless words

* feat: added types for jest

* chore: added link box

* feat: added new validation test casses & methods

* style: formated with standard

* feat: added parse method & test cases

* docs: added js docs

* chore: added default import export

* feat: imporved algorithm via replace method

* test: added two test cases

* feat: added jest type for suggestions

* feat: added `reduceRight` & `trim` method

* chore: added helper variable

* feat: added new rotation option

* Revert "chore: added helper variable"

This reverts commit 489544da0a3d479910fbea020d3be3d0d10681bf.

* remove: yarn lock

* chore: fix grammer

* feat: used replace method & added test case

* feat: remove revert

* chore: added new line

* feat: optimized algo n to n / 2 & replaced test cases

* chore: update node version

* chore: set node version to lts

* chore: updated the node version & added engines prop

* resolve: removed while loop

* chore: added right shift ops comment

* chore: update comment

* chore: removed abs

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2022-05-07 17:42:50 +05:30
b81c339b59 merge: Improve pull request template (#1002) 2022-05-04 22:32:08 +05:30
e447b5545d merge: Update directory workflow (#1000)
* chore: update directory workflow

Workflow now only runs on `pull_request` to prevent pushing on the master branch.

* chore: update commit mechanism

* chore: remove rundundant script

* Update UpdateDirectory.yml

* Updated Documentation in README.md

* Update UpdateDirectory.yml

* fix: replace wrong variable

* Updated Documentation in README.md

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-04-28 18:58:12 +05:30
6d5e641e6e merge: tweak DIRECTORY.md generation (#999)
* tests: change extention of helper file

* chore: revert previous change

* chore: ignore dirs with name "test"

* docs: update directory styling

Removed headings from `DIRECTORY.md` generation.

* refactor: make code more idiomatic

* docs: format directories to be bold

* chore: change char conting method

* fix: add 1 to ident count
2022-04-28 15:43:45 +05:30
1e0dd1c44f chore: add appgurueu to CODEOWNERS 2022-04-21 11:40:49 +05:30
40989326f1 Change 1 week to 2 weeks for stale issues 2022-04-17 20:14:59 -05:00
48e3e8d8c9 chore: use stale label to mark something as stale 2022-04-16 21:26:08 +05:30
42b9f64ea1 merge: Update workflow organization and environments (#971)
* chore: only run update directory on `master`

* chore: move codespell to CI workflow

* chore: remove codespell workflow(moved)

* chore: listen for `push` only on `master`

* chore: remove `pull_request` type params
2022-04-03 12:36:12 +05:30
cc55dabb4b merge: Updated pull_request_template (#913) 2022-03-02 21:58:41 +05:30
6bd2ac682d merge: Decrease time period for marking an issue stale (#885)
* chore: mark stale after 7 days of inactivity

* Auto-update DIRECTORY.md

* chore: length info provided in comments

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2022-02-16 19:26:34 +05:30
64920bf1a3 merge: Removed ignored code files form codespell workflow. (#834)
* Auto-update DIRECTORY.md

* chore: remove ignored code files

* chore: ignore more words

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2021-11-03 11:26:38 +05:30
308b022b03 merge: Sliding window (#833)
* new algorithm 'Sliding-Window' added with example 'Longest Substring Without Repeating Characters'

* new example of sliding window 'Permutation in String' added

* chore: add `ignore_words_list`

* sliding-window moved into Dynamic-programming directory

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2021-11-03 09:33:20 +05:30
12cf29ef18 fix: endlines in the CI file 2021-11-02 10:57:57 -06:00
3723322bd0 fix: update file name 2021-10-28 18:48:36 +05:30
9120085bdf chore: use UpperCamelCase 2021-10-28 18:46:50 +05:30
d2883fe6ef chore: use UpperCamelCase 2021-10-28 18:46:20 +05:30
01a2e9ac9e chore: use UpperCamelCase 2021-10-28 18:45:57 +05:30
2203c1a0e4 chore: use UpperCamelCase 2021-10-28 18:45:36 +05:30
072523d594 merge: Fix spellings (#821)
* chore: remove codespell from ci

* feat: add codespell workflow

* fix: codespell workflow

* fix: ignore spellings in directory

* chore: fix spellings

./Dynamic-Programming/KadaneAlgo.js:2: contiguos ==> contiguous
./Dynamic-Programming/KadaneAlgo.js:14: posible ==> possible

* chore: fix spelling

./Dynamic-Programming/SieveOfEratosthenes.js:4: upto ==> up to

* chore: fix spellings

./Dynamic-Programming/MaxNonAdjacentSum.js:22: Exmaple ==> Example

* chore: fix spelling

./Project-Euler/test/Problem010.test.js:4: upto ==> up to
./Project-Euler/test/Problem010.test.js:8: upto ==> up to
./Project-Euler/test/Problem010.test.js:12: upto ==> up to

* chore: fix spelling

./String/AlphaNumericPalindrome.js:10: recieves ==> receives
./String/AlphaNumericPalindrome.js:10: sting ==> string
./String/AlphaNumericPalindrome.js:46: varaible ==> variable

* chore: fix spelling

./String/DiceCoefficient.js:3: stings ==> strings

* chore: fix spelling

./String/test/DiceCoefficient.test.js:9: atleast ==> at least

* chore: fix spelling

./String/test/MaxWord.test.js:8: ba ==> be

* chore: ignore `PermutateString.test.js`

* chore: fix spelling

./String/test/CheckVowels.test.js:62: occurances ==> occurrences

* chore: ignore `SubsequenceRecursive.js`

* chore: fix spelling

./Conversions/TemperatureConversion.js:2: arguement ==> argument

* chore: fix spelling

./Conversions/RailwayTimeConversion.js:7: Formate ==> Format
./Conversions/RailwayTimeConversion.js:8: Formate ==> Format

* chore: remove Linear Algebra

The deleted directory hosted a package which are not accepted by this repository.

* Auto-update DIRECTORY.md

* chore: fix spelling

* chore: fix spellings

* merge: Created composite Simpson's integration method. Tests included. (#819)

* Created composite Simpson's integration method.Tests included

* Minor corrections

* Auto-update DIRECTORY.md

* Styled with standard.js

* chore: remove blank line

* chore: remove blank line

Co-authored-by: ggkogkou <ggkogkou@ggkogkou.gr>
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: remove codespell from ci

* feat: add codespell workflow

* fix: codespell workflow

* fix: ignore spellings in directory

* chore: fix spellings

./Dynamic-Programming/KadaneAlgo.js:2: contiguos ==> contiguous
./Dynamic-Programming/KadaneAlgo.js:14: posible ==> possible

* chore: fix spelling

./Dynamic-Programming/SieveOfEratosthenes.js:4: upto ==> up to

* chore: fix spellings

./Dynamic-Programming/MaxNonAdjacentSum.js:22: Exmaple ==> Example

* chore: fix spelling

./Project-Euler/test/Problem010.test.js:4: upto ==> up to
./Project-Euler/test/Problem010.test.js:8: upto ==> up to
./Project-Euler/test/Problem010.test.js:12: upto ==> up to

* chore: fix spelling

./String/AlphaNumericPalindrome.js:10: recieves ==> receives
./String/AlphaNumericPalindrome.js:10: sting ==> string
./String/AlphaNumericPalindrome.js:46: varaible ==> variable

* chore: fix spelling

./String/DiceCoefficient.js:3: stings ==> strings

* chore: fix spelling

./String/test/DiceCoefficient.test.js:9: atleast ==> at least

* chore: fix spelling

./String/test/MaxWord.test.js:8: ba ==> be

* chore: ignore `PermutateString.test.js`

* chore: fix spelling

./String/test/CheckVowels.test.js:62: occurances ==> occurrences

* chore: ignore `SubsequenceRecursive.js`

* chore: fix spelling

./Conversions/TemperatureConversion.js:2: arguement ==> argument

* chore: fix spelling

./Conversions/RailwayTimeConversion.js:7: Formate ==> Format
./Conversions/RailwayTimeConversion.js:8: Formate ==> Format

* chore: remove Linear Algebra

The deleted directory hosted a package which are not accepted by this repository.

* Auto-update DIRECTORY.md

* chore: fix spelling

* chore: fix spellings

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: fix spelling

* chore: no need to check filenames

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Co-authored-by: ggkogkou <76820848+ggkogkou@users.noreply.github.com>
Co-authored-by: ggkogkou <ggkogkou@ggkogkou.gr>
2021-10-28 15:37:43 +05:30
59e9baf11b feat: add codespell 2021-10-28 12:34:59 +05:30
54de6e5372 merge: Fix pull request template (#818)
The existing template uses * to apply the bold font weight. As we
already have the ### to markdown the text as heading, its redundant to
have the *s.
2021-10-27 23:17:32 +05:30
f640550d54 ci(workflow): add 'npm' cache for actions/setup-node in .github/workflows 2021-10-12 21:15:53 +02:00
b13b12e88c chore: merge Fix/742 migrate doctest to jest (#749)
* Remove QuickSelect doctest

There are more Jest test cases already.

* Remove AverageMedian doctest

Already migrated to jest

* Migrate doctest for BinaryExponentiationRecursive.js

(also remove inline "main" test method)

* Migrate doctest for EulersTotient.js

(also remove inline "main" test method)

* Migrate doctest for PrimeFactors.js

(also remove inline "main" test method)

* Migrate doctest for BogoSort.js

Re-write prototype-polluting helper methods, too.

(also remove inline test driver code)

* Migrate doctest for BeadSort.js

(also remove inline test driver code)

* Migrate doctest for BucketSort.js

(also remove inline test driver code)

* Migrate doctest for CocktailShakerSort.js

(also remove inline test driver code)

* Migrate doctest for MergeSort.js

(also remove inline test driver code)

* Migrate doctest for QuickSort.js

(also remove inline test driver code)

* Migrate doctest for ReverseString.js

(also remove inline test driver code)

* Migrate doctest for ReverseString.js

* Migrate doctest for ValidateEmail.js

* Migrate doctest for ConwaysGameOfLife.js

(remove the animate code, too)

* Remove TernarySearch doctest

Already migrated to jest

* Migrate doctest for BubbleSort.js

(also remove inline test driver code)

* Remove doctest from CI and from dependencies

relates to #742
fixes #586

* Migrate doctest for RgbHsvConversion.js

* Add --fix option to "standard" npm script

* Migrate doctest for BreadthFirstSearch.js

(also remove inline test driver code)

* Migrate doctest for BreadthFirstShortestPath.js

(also remove inline test driver code)

* Migrate doctest for EulerMethod.js

(also remove inline test driver code)

Move manual test-code for plotting stuff in the browser in a distinct file, too. Those "*.manual-test.js" files are excluded from the UpdateDirectory.mjs script, as well.

* Migrate doctest for Mandelbrot.js

(also remove inline test driver code & moved manual drawing test into a *.manual-test.js)

* Migrate doctest for FloodFill.js

* Migrate doctest for KochSnowflake.js

(also move manual drawing test into a *.manual-test.js)

* Update npm lockfile

* Update README and COMMITTING with a few bits & bobs regarding testing & code quality
2021-10-07 12:33:38 +05:30
7bb3c80f05 Fix URL creation in directory markdown 2021-10-05 11:23:47 +02:00
6fe322bd8a Add npm ci to directory-updating job, as well (so that we can utilize globby) 2021-10-05 11:23:47 +02:00
a69d9a8c49 Clean up and speed up UpdateDirectory.js
Uses globby to find all algorithm files. This is way quicker and less error-prone than the previous implementation. Plus, it allows us to fine-tune excludes (e.g. test files and the babel config).

This also removes the need for setTimeouts which greatly speeds up the whole thing.
2021-10-05 11:23:46 +02:00
460fd57c6b Test: Drop env.CI 2021-10-05 11:23:46 +02:00
f6396f4822 Don't cat the full DIRECTORY.md file in the github job 2021-10-05 11:23:46 +02:00
21d4096446 Another proposal: Clean up "update directory" job, as well
relates to ##720

Cleaned up and updated the job description file a bit. Instead of attempting to commit every single time, we check if the DIRECTORY file actually has changes first.
2021-10-05 11:23:46 +02:00
6f9b1f127f Proposal: Clean up CI job a bit
relates to #586 and #720

Added npm scripts for doctest and style checking via standard. This allows us to call those directly via npm and not via npx.

The CI job itself is now split into distinct steps (makes it more visible which step failed).
2021-10-05 11:23:45 +02:00
877ce463c8 chore: add code protection 2021-10-04 12:23:50 +05:30
cf98deda8e fix: Fixed TODO message
Need to add Doctests to all Algos
2021-05-22 21:20:36 +05:30
a93abac98d Fixes #539 2021-05-22 21:13:00 +05:30