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

@trivia-api/fetch

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@trivia-api/fetch - npm Package Compare versions

Comparing version 1.11.0 to 1.12.0

2

dist/fetch/src/getQuestions.d.ts

@@ -20,2 +20,2 @@ import { Question } from "../../models/src";

*/
export declare const getQuestions: (params?: GetQuestionsParams, host?: string) => Promise<Question[]>;
export declare const getQuestions: (params?: GetQuestionsParams, key?: string | null, host?: string) => Promise<Question[]>;
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -48,10 +59,14 @@ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }

*/
var getQuestions = function (params, host) {
var getQuestions = function (params, key, host) {
if (params === void 0) { params = {}; }
if (host === void 0) { host = constants_1.TRIVIA_API_BASE_URL; }
return __awaiter(void 0, void 0, void 0, function () {
var queryString, response;
var _headers, queryString, response;
return __generator(this, function (_a) {
switch (_a.label) {
case 0:
_headers = __assign({}, constants_1.headers);
if (key) {
_headers["x-api-key"] = key;
}
queryString = params && Object.keys(params).length

@@ -74,3 +89,3 @@ ? Object.entries(params).reduce(function (prev, _a, i) {

: "";
return [4 /*yield*/, axios_1["default"].get("".concat(host, "/api/questions").concat(queryString))];
return [4 /*yield*/, axios_1["default"].get("".concat(host, "/api/questions").concat(queryString), { headers: _headers })];
case 1:

@@ -77,0 +92,0 @@ response = _a.sent();

{
"name": "@trivia-api/fetch",
"version": "1.11.0",
"version": "1.12.0",
"description": "Functions to fetch data from The Trivia API.",

@@ -13,3 +13,3 @@ "keywords": [

],
"main": "dist/index.js",
"main": "dist/fetch/src/index.js",
"scripts": {

@@ -16,0 +16,0 @@ "test": "jest",

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