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

@frui.ts/apiclient

Package Overview
Dependencies
Maintainers
5
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@frui.ts/apiclient - npm Package Compare versions

Comparing version 0.16.0-beta.2 to 0.16.0-beta.3

6

dist/restRequestBuilder.d.ts
import { IApiConnector } from "./types";
import { StringifyOptions } from "query-string";
export declare function appendAcceptJsonHeader(params?: RequestInit): RequestInit;
export declare function appendUrl(base: string, ...segments: any[]): string;
export declare class RestRequestBuilder {

@@ -7,3 +9,5 @@ protected apiConnector: IApiConnector;

protected params?: RequestInit | undefined;
static DefaultQueryStringOptions: StringifyOptions;
protected urlValue: string;
queryStringOptions?: StringifyOptions;
get url(): string;

@@ -28,4 +32,4 @@ constructor(apiConnector: IApiConnector, baseUrl: string, params?: RequestInit | undefined);

withBaseUrl(url: string): this;
getQueryString(query: any): string;
protected appendQuery(url: string, query?: any): string;
}
export declare function appendUrl(base: string, ...segments: any[]): string;

46

dist/restRequestBuilder.js

@@ -14,17 +14,4 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
var query_string_1 = require("query-string");
var cleanupRegex = /\/+$/g;
function getValueForUri(input) {
if (input instanceof Date) {
return input.toISOString();
}
else {
return input;
}
}
function getQueryString(query) {
return Object.keys(query)
.filter(function (prop) { return query[prop] || query[prop] === 0; })
.map(function (prop) { return encodeURIComponent(prop) + "=" + encodeURIComponent(getValueForUri(query[prop])); })
.join("&");
}
var jsonContentType = "application/json,text/json";

@@ -35,2 +22,14 @@ function appendAcceptJsonHeader(params) {

exports.appendAcceptJsonHeader = appendAcceptJsonHeader;
function appendUrl(base) {
var segments = [];
for (var _i = 1; _i < arguments.length; _i++) {
segments[_i - 1] = arguments[_i];
}
var result = base.replace(cleanupRegex, "");
segments.forEach(function (x) {
result += "/" + x;
});
return result;
}
exports.appendUrl = appendUrl;
var RestRequestBuilder = (function () {

@@ -116,20 +115,13 @@ function RestRequestBuilder(apiConnector, baseUrl, params) {

};
RestRequestBuilder.prototype.getQueryString = function (query) {
var _a;
return query_string_1.stringify(query, (_a = this.queryStringOptions) !== null && _a !== void 0 ? _a : RestRequestBuilder.DefaultQueryStringOptions);
};
RestRequestBuilder.prototype.appendQuery = function (url, query) {
return query ? url + "?" + getQueryString(query) : url;
return query ? url + "?" + this.getQueryString(query) : url;
};
RestRequestBuilder.DefaultQueryStringOptions = { skipNull: true };
return RestRequestBuilder;
}());
exports.RestRequestBuilder = RestRequestBuilder;
function appendUrl(base) {
var segments = [];
for (var _i = 1; _i < arguments.length; _i++) {
segments[_i - 1] = arguments[_i];
}
var result = base.replace(cleanupRegex, "");
segments.forEach(function (x) {
result += "/" + x;
});
return result;
}
exports.appendUrl = appendUrl;
//# sourceMappingURL=restRequestBuilder.js.map

@@ -6,3 +6,3 @@ {

},
"version": "0.16.0-beta.2",
"version": "0.16.0-beta.3",
"description": "Frui.ts helpers for HTTP communication",

@@ -36,5 +36,6 @@ "keywords": [

"dependencies": {
"@frui.ts/helpers": "^0.16.0-beta.2"
"@frui.ts/helpers": "^0.16.0-beta.3",
"query-string": "^6.9.0"
},
"gitHead": "769c12e8d1bb8625dc1482fbae7185f6b5e123b1"
"gitHead": "467e9c7dae871601a3451aa26091703433d2d8cb"
}

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