app/assets/javascripts/knowledge_base_public_polyfills/fetch.js
File fetch.js
has 393 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// https://github.com/github/fetch
(function(self) {
'use strict';
Function Body
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Body() {
this.bodyUsed = false
this._initBody = function(body) {
this._bodyInit = body
Function fetch
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
self.fetch = function(input, init) {
return new Promise(function(resolve, reject) {
var request = new Request(input, init)
var xhr = new XMLHttpRequest()
Function Request
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Request(input, options) {
options = options || {}
var body = options.body
if (input instanceof Request) {
Function _initBody
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this._initBody = function(body) {
this._bodyInit = body
if (!body) {
this._bodyText = ''
} else if (typeof body === 'string') {