@pentops/jsonapi-request
Advanced tools
Comparing version 0.0.5 to 0.0.6
import { stringify } from 'qs'; | ||
import { v4 } from 'uuid'; | ||
@@ -58,21 +59,2 @@ /****************************************************************************** | ||
let uuid; | ||
function loadUUID() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
try { | ||
if (uuid) { | ||
return uuid; | ||
} | ||
const uuidModule = yield import('uuid'); | ||
uuid = uuidModule.v4; | ||
return uuid; | ||
} | ||
catch (_a) { } | ||
}); | ||
} | ||
(function () { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
yield loadUUID(); | ||
}); | ||
}()); | ||
function processResponse(rawResponse) { | ||
@@ -176,6 +158,3 @@ return __awaiter(this, void 0, void 0, function* () { | ||
const _a = request || {}, { body, headers } = _a, requestInit = __rest(_a, ["body", "headers"]); | ||
let traceId = ''; | ||
if (uuid) { | ||
traceId = uuid(); | ||
} | ||
const traceId = v4(); | ||
const requestOptions = Object.assign(Object.assign({ method, credentials: 'include', mode: 'cors' }, requestInit), { headers: new Headers(Object.assign({ 'Accept': 'application/json', 'Content-Type': 'application/json', 'X-Trace': traceId }, headers)) }); | ||
@@ -182,0 +161,0 @@ if (body) { |
{ | ||
"name": "@pentops/jsonapi-request", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "", | ||
@@ -35,10 +35,5 @@ "main": "dist/index.js", | ||
"peerDependencies": { | ||
"uuid": "^10.0.0", | ||
"uuid": ">=10.0.0 < 11.0.0", | ||
"qs": ">=6.0.0 < 7.0.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"uuid": { | ||
"optional": true | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
14686
183