110 Commits

Author SHA1 Message Date
3623e4270f tests: add HexToDecimal.test.js (#1662) 2024-05-25 16:31:13 +05:30
6fe21d21e9 chore: convert functions to an ES2015 classes (#1656)
* chore: convert functions to an ES2015 classes

* remove unnecessary functions
2024-04-13 23:21:54 +05:30
9c622dd089 refactor: add and use parseDate (#1643)
* refactor: add and use `parseDate`

* style: use proper spelling

Co-authored-by: appgurueu <34514239+appgurueu@users.noreply.github.com>

---------

Co-authored-by: appgurueu <34514239+appgurueu@users.noreply.github.com>
2024-04-03 20:49:26 +05:30
4a4ed57d42 refactor: use isLeapYear (#1638) 2024-03-07 10:23:43 +05:30
f13eec1bbb fix: properly floor the partial results (#1629) 2024-03-05 03:36:50 +05:30
2fe0dfde23 fix: throw form DateToDay (#1628) 2024-03-05 03:33:19 +05:30
894a46ca67 fix: throw error instead of returning it RailwayTimeConversion (#1625) 2024-03-02 13:24:46 +05:30
ce86248b1e feat: add RGB to HSL color format conversion algorithm (#1475)
* feat: add RGB to HSL color format conversion algorithm

* test: add self-tests for rgb to hsl conversion algorithm

* fix: change function code to concise format

* fix: use throw and segregate the test cases

* chore: clean up the test format

* chore: use correct styling
2023-10-11 06:15:47 +00:00
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
6291d4b611 feat: Add Length Conversion (#1390) 2023-10-02 12:35:39 +05:30
00e40e6f06 Fix/code smells (#1338)
* ♻️ refactor: improving and fixing some code

* Updated Documentation in README.md

* ♻️ refactor: improving isLeapYear

* 🐛 chore: back changes

* 🐛 fix: using reduce instead forEach

* 🐛 fix: using reduce instead forEach

* 🐛 fix: removing duplicated code

* 🐛 chore: removing .js

---------

Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
2023-08-21 23:36:43 +05:30
0c427580f1 Make ArbitraryBase Unicode-aware (#1299)
* Make ArbitraryBase Unicode-aware

https://mathiasbynens.be/notes/javascript-unicode#counting-symbols

* Fix performance bug and add Unicode test

* Add BigInt version and push output chars to array
2023-02-23 20:04:47 +05:30
002b10a5aa docs: fix typos (#1283)
* docs: fix typos

* fix
2023-02-07 22:20:28 +05:30
cc0700f122 conversion: liters to imperial gallons (#1256)
* Added liters to imperial gallons conversion

* Fixed documentation @see

* Pr suggestion
2022-10-31 22:11:29 +05:30
b634aa581c conversion: liters to US gallons (#1255) 2022-10-31 22:07:48 +05:30
8cbaf2e299 convertion: ounce to kilogram (#1248)
* Added ounces to kilograms convertion

* Added PR suggestions

* changed to export default
2022-10-31 22:05:58 +05:30
d94929ea0d fix: DateToDay (#1125) 2022-10-10 11:31:58 +05:30
360c447e72 merge: Add test case to HexToRGB algorithm (#1018) 2022-05-17 19:29:42 +05:30
bb2338216e merge: Add test case to RGBToHex & RailwayTimeConversion algorithm (#935) 2022-03-19 21:20:03 +05:30
5302002197 merge: Add test case to LowerCaseConversion (#934) 2022-03-18 21:13:19 +05:30
e33503fc58 merge: Add test case to DecimalToBinary,DecimalToOctal & OctToDecimal (#932) 2022-03-18 13:57:40 +05:30
19924251be merge: Add test cases to ArbitraryBase, DateToDay & DateDayDifference Algorithm (#929) 2022-03-16 17:10:31 +05:30
378d4abebc merge: Upgraded hexToBinary function (#910)
* feat: used js object intead of switch

* pref: optimzed the algo with regex & replace method

* feat: add hex validation with test case

* feat: add type validation

* chore: fix grammar mistake

* docs: add binLookup comments
2022-03-02 09:40:07 +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
32f1e3351c merge: Added Hex to Binary conversion (#805)
* Added Hex to Binary conversion

* Update Conversions/HexToBinary.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Update Conversions/HexToBinary.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Update Conversions/HexToBinary.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Update Conversions/HexToBinary.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Fix errors

* fix: typo

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2021-10-24 14:26:56 +05:30
d5e309b605 merge: Add binary to decimal test file and convert function to es6 model. (#806)
* Added Hex to Binary conversion

* Add Binary to decimal test

* Fix Style
2021-10-23 23:16:13 +05:30
22ce7603e4 fix: standard style issues 2021-10-21 22:59:56 +05:30
d38ebe5199 chore: Merge pull request #768 from lvlte/issues/720
Changes for consolidation
2021-10-21 19:32:55 +05:30
79c7ce45c8 Fixed != to !== and ran npm run style 2021-10-21 15:57:20 +05:30
92d6ed6e7d chore: Merge pull request #798 from Japoncio3k/master
Create DistanceConversion.js
2021-10-21 14:42:30 +05:30
67ac0c3dd3 Added jest test and renamed file 2021-10-20 14:33:59 -03:00
5570dc46b4 Create DistanceConversion.js 2021-10-19 15:04:17 -03:00
0f39167538 Added BinaryToHex Conversion 2021-10-14 19:34:10 +07:00
274686a5fe RomanToDecimal : Fix import (typo). 2021-10-11 16:33:44 +02:00
df4a783b06 Complying with JavaScript Standard Style (npx standard --fix). 2021-10-11 15:49:24 +02:00
9218a5c73e RomanToDecimal : live test and example were removed, adding Jest test instead. 2021-10-11 14:51:30 +02:00
e18718b7d5 Remove live code & console.log, leave examples as comments. 2021-10-11 14:07:10 +02:00
30779682b9 Conversions algorithms : remove live code & console.log. 2021-10-09 18:15:30 +02:00
cbe7e0c89f Comply with ESM syntax. 2021-10-09 13:18:40 +02:00
a83168c450 chore: Merge pull request #756 from nibble-4bits/algorithm/bufferToBase64
Create algorithm for converting binary data to base64
2021-10-08 13:30:50 +05:30
d6193f6a8a Create algorithm for converting base64 to binary data 2021-10-08 00:51:04 -05:00
5d56140699 Add comment linking to base64 article in Wikipedia 2021-10-08 00:22:10 -05:00
281c675d63 Create algorithm for converting binary data to base64 2021-10-08 00:19:00 -05:00
124d2010f0 chore: merge Added Temperature Conversions to Javascript (#705)
* Added Temperature Conversions to Javascript

I added a file which contains essential conversions needed to swap temperature units to one another.
Hope you like it :)

* Update Conversions/TemperatureConversion.js

Suggestions saved

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Added test file 

"test" folder was created and tests required for "TemperatureConversions" was added to it

* Fixed minor syntax errors

* Update Conversions/test/TemperatureConversion.test.js

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>

* Formatted TemperatureConversion.js 

The code was modified to comply with rules and styes recommended by the repository

* Formatted TemperatureConversion.test.js 

The code was modified to comply with rules and styes recommended by the repository

* Reformatted :) 

Hope this passes the test :)

Co-authored-by: Rak Laptudirm <raklaptudirm@gmail.com>
2021-10-07 13:10:54 +05:30
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
73402d5140 chore: Merge pull request #733 from charliejmoore/upper-case-converstion-tests
Upper case conversion tests
2021-10-05 14:24:28 +05:30
e27bc0a702 resolved conflicts 2021-10-05 14:05:11 +05:30
1589263947 fixed some spellings 2021-10-05 12:49:23 +05:30
ced6c891a6 Add tests for titleCaseConversion function 2021-10-04 12:23:05 -04:00
654c824fdd Add check to handle empty string input.
Could throw an error instead, but to be consistent with other case conversion functions in this collection, it returns an empty string when input is empty string.
2021-10-04 12:21:34 -04:00