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

@kitql/helper

Package Overview
Dependencies
Maintainers
1
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kitql/helper - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

queryStringApprend.d.ts

1

index.d.ts
export { Log, logCyan, logGreen, logRed } from './Log';
export { queryStringApprend } from './queryStringApprend';

@@ -41,2 +41,32 @@ 'use strict';

/**
* Add things to the queryString.
*
* Normal usage:
* ```
* goto(`?${queryStringApprend($page.url.searchParams, { focus: "Hello" })}`);
* ```
* @param searchParams usually: $page.url.searchParams
* @param queryString an object with key value pairs, something like { focus: "Hello" }
* @returns a sorted query string
*/
function queryStringApprend(searchParams, queryString) {
let query = {};
// 1 Destructure searchParams
searchParams.forEach((v, k) => {
query[k] = v;
});
// 2 Upset with our queryString
for (const key in queryString) {
query[key] = queryString[key];
}
// 3 Transform in a table
let qs = [];
for (const key in query) {
qs.push(`${key}=${query[key]}`);
}
// 4 send back the Query String
return qs.sort().join('&');
}
exports.Log = Log;

@@ -46,1 +76,2 @@ exports.logCyan = logCyan;

exports.logRed = logRed;
exports.queryStringApprend = queryStringApprend;

2

package.json
{
"name": "@kitql/helper",
"version": "0.0.3",
"version": "0.0.4",
"dependencies": {

@@ -5,0 +5,0 @@ "pino": "7.6.5",

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