I'm trying to add custom method in Header class.
class RequestModule extends Headers {
customMethod() {}
}
this.customHeaders = new RequestModule({headers})
this.customHeaders.customMethod()
When I'm trying to use this method, in Safari raised an error
Unhandled Promise Rejection: TypeError: this.customHeaders.customMethod is not a function.
(In 'this.customHeaders.customMethod(options)', 'this.customHeaders.customMethod' is
undefined)`
When I debug this.customHeaders in Safari's console, I have following output:
append()
constructor: function()
delete()
entries()
forEach()
get()
has()
keys()
set()
values()
Symbol(Symbol.iterator)()
but in Chrome everything works as expected and custom methods created in RequestModule and returned to customHeaders
Is it specific Safari issue? How can I extend Headers class in Safari?