Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rubik-pact

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rubik-pact - npm Package Compare versions

Comparing version 1.0.7 to 1.0.8

23

classes/Pact.js

@@ -75,3 +75,7 @@ const { Kubik } = require('rubik-main');

method = method || 'POST';
if (!method) {
if (body) method = 'POST';
else method = 'GET';
}
if (body instanceof FormData) {

@@ -82,15 +86,16 @@ Object.assign(headers, body.getHeaders());

headers['Content-Type'] = 'application/json';
} else {
method = 'GET';
}
const request = await fetch(url, { method, body, headers });
// console.log(await request.text());
const result = await request.json();
const res = await fetch(url, { method, body, headers });
if (res.status !== 200) {
throw new Error(`Invalid status ${res.status}`);
};
if (result.status === 'errored') {
throw new PactError(`${get(result, 'errors.0.code')} ${get(result, 'errors.0.description')}`);
const resBody = await res.json();
if (resBody.status === 'errored') {
throw new PactError(`${get(resBody, 'errors.0.code')} ${get(resBody, 'errors.0.description')}`);
}
return result;
return resBody;
}

@@ -97,0 +102,0 @@

{
"name": "rubik-pact",
"version": "1.0.7",
"version": "1.0.8",
"description": "Pact Bot Api kubik for the Rubik application system",

@@ -5,0 +5,0 @@ "main": "classes/Pact.js",

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