How can I write typescript conforming to the following javascript?
var _ =require('lodash');
var Controller=function(){};
Controller.prototype.index=function(req,res){
res.ok();
};
Controller.extend=function(object){
return _.extend({},Controller.prototype,object);
};
I tried the following typescript but it adds the extension as Controller.prototype.extend instead of Controller.extend ()
var _ = require('lodash');
class Controller
{
index(){
console.log("hi");
}
extends(object) {
return _.extend({}, Controller.prototype, object);
}
}
how can i change my typescript to get the above javascript?
+3
source to share