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

@vssue/utils

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vssue/utils - npm Package Compare versions

Comparing version 1.4.0 to 1.4.7

lib/buildQuery.d.ts

24

lib/index.d.ts

@@ -1,17 +0,7 @@

export declare const buildURL: (cleanURL: string, params: Record<string, string | number>) => string;
export declare const concatURL: (baseURL: string, path: string) => string;
export declare const getCleanURL: (fullURL: string) => string;
export declare const parseQuery: (URL: string) => Record<string, string>;
export declare const buildQuery: (params: Record<string, string | number>) => string;
export declare const formatDateTime: (str: string) => string;
export declare const noop: () => void;
declare const _default: {
buildURL: (cleanURL: string, params: Record<string, string | number>) => string;
concatURL: (baseURL: string, path: string) => string;
getCleanURL: (fullURL: string) => string;
parseQuery: (URL: string) => Record<string, string>;
buildQuery: (params: Record<string, string | number>) => string;
formatDateTime: (str: string) => string;
noop: () => void;
};
export default _default;
export * from './buildQuery';
export * from './buildURL';
export * from './concatURL';
export * from './formatDateTime';
export * from './getCleanURL';
export * from './noop';
export * from './parseQuery';

@@ -1,34 +0,8 @@

import format from 'date-fns/format';
import { parse, stringify } from 'qs';
export const buildURL = (cleanURL, params) => {
const query = stringify(params, { addQueryPrefix: true });
return `${cleanURL}${query}`;
};
export const concatURL = (baseURL, path) => {
const firstPart = baseURL.replace(/\/$/, '');
const secondPart = path.replace(/^\//, '');
return `${firstPart}/${secondPart}`;
};
export const getCleanURL = (fullURL) => {
const noHash = fullURL.split('#')[0] || '';
const cleanURL = noHash.split('?')[0] || '';
return cleanURL;
};
export const parseQuery = (URL) => parse(URL, { ignoreQueryPrefix: true });
export const buildQuery = (params) => stringify(params);
export const formatDateTime = (str) => {
const dateTime = format(str, 'YYYY-MM-DD HH:mm:ss');
return dateTime;
};
// eslint-disable-next-line @typescript-eslint/no-empty-function
export const noop = () => { };
export default {
buildURL,
concatURL,
getCleanURL,
parseQuery,
buildQuery,
formatDateTime,
noop,
};
export * from './buildQuery';
export * from './buildURL';
export * from './concatURL';
export * from './formatDateTime';
export * from './getCleanURL';
export * from './noop';
export * from './parseQuery';
//# sourceMappingURL=index.js.map
{
"name": "@vssue/utils",
"version": "1.4.0",
"version": "1.4.7",
"description": "Vssue internal utils",

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

},
"gitHead": "c31210f04dcb4f114488e45d5835c89196492026"
"gitHead": "c5b59865ac64a0165df4248db69591b044037267"
}

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