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

@sibipro/ask

Package Overview
Dependencies
Maintainers
7
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sibipro/ask - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

2

ask.js

@@ -17,3 +17,3 @@ const fetch = require('node-fetch');

module.exports = async function ask(url, config) {
module.exports = async function ask(url, config = {}) {
const { responseType, ...init } = { ...defaults, ...encodeBody(config) };

@@ -20,0 +20,0 @@ const response = await fetch(url, init);

@@ -67,2 +67,13 @@ const fetch = require('node-fetch');

test('works without a config object', async () => {
fetch.mockResolvedValue({
ok: true,
json: jest.fn(() => ['url 1', 'url 2']), // treats response as json by default
});
const response = await ask('test/fetch/url');
expect(response).toEqual(['url 1', 'url 2']);
});
test('response not ok throws error', async () => {

@@ -69,0 +80,0 @@ fetch.mockResolvedValue({

{
"name": "@sibipro/ask",
"version": "1.2.0",
"version": "1.2.1",
"main": "index.js",

@@ -5,0 +5,0 @@ "license": "MIT",

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