New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@pentops/jsonapi-request

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@pentops/jsonapi-request - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

1

dist/index.d.ts

@@ -11,2 +11,3 @@ import { APIError } from './error';

export declare function makeRequest<TRes, TReqBody extends unknown = undefined>(method: HTTPMethod, path: string, request?: TypedRequestInit<TReqBody>): Promise<TRes | undefined>;
export declare function makeCancellableRequest<TRes, TReqBody extends unknown = undefined>(method: HTTPMethod, path: string, request?: TypedRequestInit<TReqBody>): [Promise<TRes | undefined>, AbortController];
//# sourceMappingURL=index.d.ts.map

@@ -17,3 +17,3 @@ import { stringify } from 'qs';

***************************************************************************** */
/* global Reflect, Promise, SuppressedError, Symbol */
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */

@@ -52,3 +52,3 @@

super(message);
this.name = this.constructor.name;
this.name = 'APIError';
this.status = status;

@@ -61,6 +61,20 @@ this.requestIdentifier = requestIdentifier;

let uuid;
try {
uuid = require('uuid').v4;
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) { }
});
}
catch (_a) { }
(function () {
return __awaiter(this, void 0, void 0, function* () {
yield loadUUID();
});
}());
function processResponse(rawResponse) {

@@ -73,2 +87,5 @@ return __awaiter(this, void 0, void 0, function* () {

return (yield rawResponse.blob());
case 'multipart/form-data':
case 'application/x-www-form-urlencoded':
return (yield rawResponse.formData());
default:

@@ -178,3 +195,7 @@ return (yield rawResponse.text());

}
function makeCancellableRequest(method, path, request) {
const controller = new AbortController();
return [makeRequest(method, path, Object.assign(Object.assign({}, request), { signal: controller.signal })), controller];
}
export { APIError, buildMergedRequestInit, buildSearchString, buildSplitRequestInit, makeRequest };
export { APIError, buildMergedRequestInit, buildSearchString, buildSplitRequestInit, makeCancellableRequest, makeRequest };

13

package.json
{
"name": "@pentops/jsonapi-request",
"version": "0.0.4",
"version": "0.0.5",
"description": "",

@@ -22,9 +22,9 @@ "main": "dist/index.js",

"@rollup/plugin-typescript": "^11.1.6",
"@types/node": "^22.3.0",
"@types/node": "^22.5.4",
"@types/qs": "^6.9.15",
"@types/uuid": "^10.0.0",
"rollup": "^4.20.0",
"rollup": "^4.21.3",
"rollup-plugin-peer-deps-external": "^2.2.4",
"tslib": "^2.6.3",
"typescript": "^5.5.4"
"tslib": "^2.7.0",
"typescript": "^5.6.2"
},

@@ -36,3 +36,4 @@ "dependencies": {

"peerDependencies": {
"uuid": "^10.0.0"
"uuid": "^10.0.0",
"qs": ">=6.0.0 < 7.0.0"
},

@@ -39,0 +40,0 @@ "peerDependenciesMeta": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc