Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
ajax(config) {
// build the request info object.
let requestInfo = {
adapter: this,
config: extend({}, config),
zConfig: config,
success: config.success,
error: config.error
};
requestInfo.config.request = this.httpClient;
requestInfo.config.headers = extend({}, config.headers);
// submit the request-info for interception.
if (breeze.core.isFunction(this.requestInterceptor)) {
this.requestInterceptor(requestInfo);
if (this.requestInterceptor.oneTime) {
this.requestInterceptor = null;
}
if (!requestInfo.config) {
return;
}
}
config = requestInfo.config;
let init = {
method: config.type
}
// headers: fetch
init.headers = new Headers();
for (let header in config.headers) {
ajax(config) {
// build the request info object.
let requestInfo = {
adapter: this,
config: extend({}, config),
zConfig: config,
success: config.success,
error: config.error
};
requestInfo.config.request = this.httpClient;
requestInfo.config.headers = extend({}, config.headers);
// submit the request-info for interception.
if (breeze.core.isFunction(this.requestInterceptor)) {
this.requestInterceptor(requestInfo);
if (this.requestInterceptor.oneTime) {
this.requestInterceptor = null;
}
if (!requestInfo.config) {
return;
}
}
config = requestInfo.config;
let init = {
method: config.type
}
// headers: fetch
init.headers = new Headers();
for (let header in config.headers) {
var _dec, _class;
import breeze from 'breeze-client';
import { subscriberCollection, ObserverLocator } from 'aurelia-binding';
import { HttpClient } from 'aurelia-fetch-client';
const extend = breeze.core.extend;
export let HttpResponse = class HttpResponse {
constructor(status, data, headers, config) {
this.config = config;
this.status = status;
this.data = data;
this.headers = headers;
}
getHeader(headerName) {
return this.getHeaders(headerName);
}
getHeaders(headerName) {
if (headerName === null || headerName === undefined || headerName === '') {
return this.headers.headers;
import breeze from 'breeze-client';
const extend = breeze.core.extend;
export class HttpResponse {
constructor(status, data, headers, config) {
this.config = config;
this.status = status;
this.data = data;
this.headers = headers;
}
getHeader(headerName) {
return this.getHeaders(headerName);
}
getHeaders(headerName) {
if (headerName === null || headerName === undefined || headerName === '') {
return this.headers.headers;
var _dec, _class;
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
import breeze from 'breeze-client';
import { subscriberCollection, ObserverLocator } from 'aurelia-binding';
import { HttpClient } from 'aurelia-fetch-client';
var extend = breeze.core.extend;
export var HttpResponse = function () {
function HttpResponse(status, data, headers, config) {
this.config = config;
this.status = status;
this.data = data;
this.headers = headers;
}
HttpResponse.prototype.getHeader = function getHeader(headerName) {
return this.getHeaders(headerName);
};
HttpResponse.prototype.getHeaders = function getHeaders(headerName) {
import breeze from 'breeze-client';
import {subscriberCollection,ObserverLocator} from 'aurelia-binding';
import {HttpClient} from 'aurelia-fetch-client';
const extend = breeze.core.extend;
export class HttpResponse {
constructor(status, data, headers, config) {
this.config = config;
this.status = status;
this.data = data;
this.headers = headers;
}
getHeader(headerName) {
return this.getHeaders(headerName);
}
getHeaders(headerName) {
if (headerName === null || headerName === undefined || headerName === '') {
return this.headers.headers;
ajax(config) {
let requestInfo = {
adapter: this,
config: extend({}, config),
zConfig: config,
success: config.success,
error: config.error
};
requestInfo.config.request = this.httpClient;
requestInfo.config.headers = extend({}, config.headers);
if (breeze.core.isFunction(this.requestInterceptor)) {
this.requestInterceptor(requestInfo);
if (this.requestInterceptor.oneTime) {
this.requestInterceptor = null;
}
if (!requestInfo.config) {
return;
}
}
config = requestInfo.config;
let init = {
method: config.type
};
init.headers = new Headers();
for (let header in config.headers) {
AjaxAdapter.prototype.ajax = function ajax(config) {
var requestInfo = {
adapter: this,
config: extend({}, config),
zConfig: config,
success: config.success,
error: config.error
};
requestInfo.config.request = this.httpClient;
requestInfo.config.headers = extend({}, config.headers);
if (breeze.core.isFunction(this.requestInterceptor)) {
this.requestInterceptor(requestInfo);
if (this.requestInterceptor.oneTime) {
this.requestInterceptor = null;
}
if (!requestInfo.config) {
return;
}
}
config = requestInfo.config;
var init = {
method: config.type
};
init.headers = new Headers();
for (var header in config.headers) {