let users = {foo: {bar: {function baz() {
this.req()
}}}}
let test = {function test() {
this.req()
}}
class API{
req() {
console.log('req')
}
}
Object.assign(API.prototype, {users})
new API().users.foo.bar.baz()//this undefined
Object.assign(API.prototype, test)
new API().test()//req