@substrate/playground-client
Advanced tools
Comparing version 1.8.0 to 1.8.1
@@ -11,10 +11,2 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import { fetchWithTimeout, rpc } from './rpc'; | ||
function extractCookies(response) { | ||
const raw = response.headers.raw()['set-cookie']; | ||
return raw.map((entry) => { | ||
const parts = entry.split(';'); | ||
const cookiePart = parts[0]; | ||
return cookiePart; | ||
}).join(';'); | ||
} | ||
export class Client { | ||
@@ -30,3 +22,3 @@ constructor(base, timeout = 10000, defaultInit) { | ||
const response = yield fetchWithTimeout(`${this.path('login')}?bearer=${bearer}`, init, this.timeout); | ||
const headers = this.defaultInit.headers; | ||
const headers = this.defaultInit.headers || new Headers(); | ||
if (!(headers instanceof Headers)) { | ||
@@ -41,3 +33,3 @@ throw Error('Unsupported headers type'); | ||
yield fetchWithTimeout(this.path('logout'), init, this.timeout); | ||
const headers = this.defaultInit.headers; | ||
const headers = this.defaultInit.headers || new Headers(); | ||
if (!(headers instanceof Headers)) { | ||
@@ -44,0 +36,0 @@ throw Error('Unsupported headers type'); |
@@ -71,10 +71,2 @@ "use strict"; | ||
var rpc_1 = require("./rpc"); | ||
function extractCookies(response) { | ||
var raw = response.headers.raw()['set-cookie']; | ||
return raw.map(function (entry) { | ||
var parts = entry.split(';'); | ||
var cookiePart = parts[0]; | ||
return cookiePart; | ||
}).join(';'); | ||
} | ||
var Client = /** @class */ (function () { | ||
@@ -97,3 +89,3 @@ function Client(base, timeout, defaultInit) { | ||
response = _a.sent(); | ||
headers = this.defaultInit.headers; | ||
headers = this.defaultInit.headers || new Headers(); | ||
if (!(headers instanceof Headers)) { | ||
@@ -117,3 +109,3 @@ throw Error('Unsupported headers type'); | ||
_a.sent(); | ||
headers = this.defaultInit.headers; | ||
headers = this.defaultInit.headers || new Headers(); | ||
if (!(headers instanceof Headers)) { | ||
@@ -120,0 +112,0 @@ throw Error('Unsupported headers type'); |
{ | ||
"name": "@substrate/playground-client", | ||
"version": "1.8.0", | ||
"version": "1.8.1", | ||
"description": "An isomorphic client for Substrate Playground", | ||
@@ -5,0 +5,0 @@ "main": "dist/main/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
87358
1899