@ -10,8 +10,9 @@ const trim = (str = '', ch?: string) => {
|
|||||||
return start > 0 || end < str.length ? str.substring(start, end) : str;
|
return start > 0 || end < str.length ? str.substring(start, end) : str;
|
||||||
};
|
};
|
||||||
|
|
||||||
const trimSlash = (s) => trim(trim(s, '/'));
|
const trimSlash = (s: string) => trim(trim(s, '/'));
|
||||||
const createPath = (...params) => {
|
|
||||||
|
const createPath = (...params: string[]) => {
|
||||||
const paths = params.filter((el) => !!el).join('/');
|
const paths = params.filter((el) => !!el).join('/');
|
||||||
return '/' + paths + (SITE.trailingSlash && paths ? '/' : '');
|
return '/' + paths + (SITE.trailingSlash && paths ? '/' : '');
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
/* eslint-disable no-mixed-spaces-and-tabs */
|
/* eslint-disable no-mixed-spaces-and-tabs */
|
||||||
/** */
|
export const getFormattedDate = (date: Date) =>
|
||||||
export const getFormattedDate = (date) =>
|
|
||||||
date
|
date
|
||||||
? new Date(date).toLocaleDateString('en-us', {
|
? new Date(date).toLocaleDateString('en-us', {
|
||||||
year: 'numeric',
|
year: 'numeric',
|
||||||
|
Reference in New Issue
Block a user