Socket
Socket
Sign inDemoInstall

@spinque/query-api

Package Overview
Dependencies
Maintainers
0
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinque/query-api - npm Package Compare versions

Comparing version 0.17.0 to 0.17.1

1

dist/utils.d.ts

@@ -11,2 +11,3 @@ import { ApiConfig, Query } from '.';

export declare const pathFromQuery: (query: Query) => string;
export declare const apiUrl: (config: ApiConfig) => string;
/**

@@ -13,0 +14,0 @@ * Takes an ApiConfig object and array of Query objects and returns a Query API request URL.

@@ -39,3 +39,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.isBrowser = exports.stringifyQueries = exports.parseQueries = exports.join = exports.tupleListToString = exports.stringToTupleList = exports.urlFromQueries = exports.pathFromQuery = exports.pathFromQueries = void 0;
exports.isBrowser = exports.stringifyQueries = exports.parseQueries = exports.join = exports.tupleListToString = exports.stringToTupleList = exports.urlFromQueries = exports.apiUrl = exports.pathFromQuery = exports.pathFromQueries = void 0;
/**

@@ -62,2 +62,28 @@ * Takes an array of Query objects and returns the path they would represent in a Query API request URL.

exports.pathFromQuery = pathFromQuery;
var apiUrl = function (config) {
if (!config.baseUrl) {
throw new Error('Base URL missing');
}
if (!config.version) {
throw new Error('Version missing');
}
if (!config.workspace) {
throw new Error('Workspace missing');
}
if (!config.api) {
throw new Error('API name missing');
}
var url = config.baseUrl;
if (!url.endsWith('/')) {
url += '/';
}
// Construct base URL containing Spinque version and workspace
url += (0, exports.join)(config.version, config.workspace, 'api', config.api);
// Add config if provided
if (config.config) {
url += "?config=".concat(config.config);
}
return url;
};
exports.apiUrl = apiUrl;
/**

@@ -64,0 +90,0 @@ * Takes an ApiConfig object and array of Query objects and returns a Query API request URL.

2

package.json
{
"name": "@spinque/query-api",
"version": "0.17.0",
"version": "0.17.1",
"description": "",

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

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