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

newsware

Package Overview
Dependencies
Maintainers
1
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

newsware - npm Package Compare versions

Comparing version 10.0.0-beta.19 to 10.0.0-beta.20

2

lib/src/api.d.ts

@@ -15,3 +15,3 @@ import { CategoryCode, EndpointDescription, HistoricalFilter, News, RestResponse, RestResponseError, RestResponseSuccess, SourceDetails } from "./types";

put<T, Z>(path: string, body: T, errorHandler?: (apiResponse: RestResponseError<Z>) => void): Promise<RestResponseSuccess<Z>>;
request<T>(method: string, path: string, params?: any, errorHandler?: (apiResponse: RestResponseError<T>) => void): Promise<RestResponse<T>>;
request<T>(method: string, path: string, params?: object, errorHandler?: (apiResponse: RestResponseError<T>) => void): Promise<RestResponse<T>>;
private requestWithBody;

@@ -18,0 +18,0 @@ handle<T>(res: Response, handleError: (apiResponse: RestResponseError<T>) => void): Promise<RestResponse<T>>;

@@ -72,3 +72,11 @@ "use strict";

try {
const endpoint = this.restEndpoint + path + (params ? "?" + new URLSearchParams(params) : '');
var paramsString = {};
if (params) {
Object.keys(params).forEach(key => {
paramsString[key] = typeof params[key] === "object"
? JSON.stringify(params[key])
: params[key];
});
}
const endpoint = this.restEndpoint + path + (paramsString ? "?" + new URLSearchParams(paramsString) : '');
const res = yield (0, isomorphic_fetch_1.default)(endpoint, {

@@ -75,0 +83,0 @@ method: method,

{
"name": "newsware",
"version": "10.0.0-beta.19",
"version": "10.0.0-beta.20",
"description": "Typescript client for interacting with the Newsware API",

@@ -5,0 +5,0 @@ "main": "lib/src/index.js",

@@ -81,7 +81,16 @@ import {

path: string,
params?: any,
params?: object,
errorHandler: (apiResponse: RestResponseError<T>) => void = this.handleError
): Promise<RestResponse<T>> {
try {
const endpoint = this.restEndpoint + path + (params ? "?" + new URLSearchParams(params) : '')
var paramsString: Record<string, string> = {}
if (params) {
Object.keys(params).forEach(key => {
paramsString[key] = typeof params[key as keyof object] === "object"
? JSON.stringify(params[key as keyof object])
: params[key as keyof object]
})
}
const endpoint = this.restEndpoint + path + (paramsString ? "?" + new URLSearchParams(paramsString) : '')
const res = await fetch(endpoint, {

@@ -88,0 +97,0 @@ method: method,

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