Merge pull request #77 from Alaev/main

Add types
This commit is contained in:
prototypa
2023-01-05 15:26:39 -05:00
committed by GitHub
2 changed files with 4 additions and 4 deletions

View File

@ -10,8 +10,9 @@ const trim = (str = '', ch?: string) => {
return start > 0 || end < str.length ? str.substring(start, end) : str;
};
const trimSlash = (s) => trim(trim(s, '/'));
const createPath = (...params) => {
const trimSlash = (s: string) => trim(trim(s, '/'));
const createPath = (...params: string[]) => {
const paths = params.filter((el) => !!el).join('/');
return '/' + paths + (SITE.trailingSlash && paths ? '/' : '');
};

View File

@ -1,6 +1,5 @@
/* eslint-disable no-mixed-spaces-and-tabs */
/** */
export const getFormattedDate = (date) =>
export const getFormattedDate = (date: Date) =>
date
? new Date(date).toLocaleDateString('en-us', {
year: 'numeric',