0

Can anyone explain what the code below does? what do both the .extend() and . register() do to the require('something')?

module.exports = require('something')
    .extend(function() {})
    .register('another thing');
DNAngel
  • 7
  • 4
  • 5
    That depends on what `something` does. Those are methods of the `something` module. – deceze Oct 24 '17 at 13:42
  • see this https://stackoverflow.com/questions/171251/how-can-i-merge-properties-of-two-javascript-objects-dynamically – ferhado Oct 24 '17 at 13:43
  • here is the sample code: https://github.com/edenjs/ipay88/blob/master/ipay88/base.js Ferhad Othman, are you sure this and the merging are the same thing? – DNAngel Oct 24 '17 at 13:48
  • deceze, I don't see those methods (extend and register) in his eden-class.js here is the code: https://github.com/edenjs/class/blob/master/class.js – DNAngel Oct 24 '17 at 13:50
  • @DNAngel Then they're probably inherited from `classified-magic` – Bergi Oct 24 '17 at 13:56
  • Bergi, magic is cool, but I hate it when it is in code. =( Please advise if you guys know what the methods do. I am in JS for about 2 months, so any helps would be awesome. I'll take a look at it as well. – DNAngel Oct 24 '17 at 14:15
  • I found that `classified-magic` github was taken down. https://github.com/cblanquera/magic – DNAngel Oct 24 '17 at 14:19

0 Answers0