fave77 / Mathball

A JavaScript library for Competitive Programming
https://fave77.github.io/Mathball-Docs/
MIT License
99 stars 49 forks source link

Method Verification #136

Closed fave77 closed 5 years ago

fave77 commented 5 years ago

Do the checklist before filing the issue:

NOTE: Provide a clear and concise description of the feature that needs to be added! Or if its a bug, then provide the necessary steps to reproduce it along with screenshots.

If you take a look at M.check(), M.find() & M.range() modules:

       ...
       return require(`../${arg}`).check;
       ...
       ...
       return require(`../${arg}`).find;
       ...
       ...
       return require(`../${arg}`).range;
       ...

If someone passes 'sum' as an argument then it wouldn't work since sum doesn't have an exported method namely, check, find & range;

So, provide an explicit error handling that throws an error whenever anyone passes another module name as an argument - Error: Invalid Argument! Hint:

         ...
         const number = require('../${arg}');
         if('check' in number) return number.check;
         else /* throw an error */
         ...

Similarly, implement it for M.find() & M.range().

atsutton commented 5 years ago

Hello, I'd like to take a crack at this bug. Is that alright?

fave77 commented 5 years ago

@atsutton this issue is only for gssoc19 participants!

robotjellyzone commented 5 years ago

Hello!! i would like to work on it please assign it to me!!

fave77 commented 5 years ago

@robotjellyzone you're assigned

fave77 commented 5 years ago

@robotjellyzone your time's up!

devRD commented 5 years ago

can I work on this?

fave77 commented 5 years ago

@devRD you're assigned