[x] Do you have Node.js and all the relevant dev-dependencies installed?
[ ] Is this a bug fix?
[x] Is this an enhancement?
[x] Is this a feature request?
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.
Give your answer below:
Function: M.find()
Argument: String
Return-Type: Function
Usage:
const factorial = M.find('factorial'); /* returns the function for 'finding' the nth-factorial */
factorial(5); /* 120 */
- Implementation:
- Inside the module **find**, provide an _index.js_:
```js
module.exports = arg => {
/* first validate the argument here ... */
/* return the corresponding function */
return require(`../${arg}`).find;
};
Changes:
Test this feature by only tweaking factorial module i.e. you need to change line 21:
exports.factorial = num => {
/* should change into */
exports.find = num => {
Similarly, also make changes in factorial-spec.js, line 2:
factorial = require('../src/factorial').factorial;
/* should change into */
factorial = require('../src/factorial').find;
Accordingly make changes in src/index.js and remove any factorial hooks and add find module via which we can access factorial or any nth-number.
[NOTE: M.factorial() will be deprecated after resolving this issue and similarly, within the next few weeks, we're gonna migrate to M.find() for finding all nth-number modules. Do not change any other nth number module for now, just stick with factorial. A separate issue will be opened for that once this one gets successfully resolved.]
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.
/ OR /
M.find('factorial')(7); / 5040 / M.find('bell')(5); / 52 /
[NOTE: M.factorial() will be deprecated after resolving this issue and similarly, within the next few weeks, we're gonna migrate to M.find() for finding all nth-number modules. Do not change any other nth number module for now, just stick with factorial. A separate issue will be opened for that once this one gets successfully resolved.]