@vssue/utils
Advanced tools
Comparing version 1.4.0 to 1.4.7
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6452
27
48