I have a class which I created static functions in it file1
, but when i import it in another file and create a new static function it doesn't work as expected it gives me that my new static function is not a function in file3
, How can i fix this?
Here's my code:
//file1
class Qbs {
static getRfreshToken(selectors = {}, projection = {}) {
return QuickBoooks.findOne(selectors, projection);
}
static updateRefreshToken(tokenId, tokenValue) {
return QuickBoooks.update(tokenId, { $set: { refreshToken: tokenValue } });
}
}
export default Qbs;
}
//file2
const Qbs = require('./index');
module.exports = function () {
Qbs.prototype.sayMyName = function () {
return 'zeyad';
};
};
//file3
import Qbs from './file1'
console.log(Qbs.sayMyName()); //sayMyName is not a function