typescript

Signed-off-by: Traxus <shyidx@gmail.com>
This commit is contained in:
Traxus 2023-04-21 19:39:46 -04:00
parent 1ee8db732f
commit 6278a07e72

View File

@ -67,21 +67,15 @@ function getPageQueryBypassWhitelist() {
}
function getListingQueryDirectories() {
//-----acts as a whitelist, but also points to the directory name of the listing if ever desired to make code less WET.
//-----whitelist the listying types of content...
let directories : any[] = [];
let directories : string[] = [];
//-----blog + category is handled in its own annoyingly special way
//-----could bundle it in here to be DRY and verbose but will not in the intrest of current time/budget
//directories['allBlogPosts'] = 'blogPost';
//directories['allCategories'] = 'category';
directories['allEvents'] : any = 'event';
directories['allPositions'] : any = 'position';
directories['allPressReleases'] : any = 'pressRelease';
directories['allTeams'] : any = 'team';
directories['allTestimonials'] : any = 'testimonial';
directories.push('allEvents');
directories.push('allPositions)';
directories.push('allPressReleases');
directories.push('allTeams');
directories.push('allTestimonials');
return directories;
@ -90,12 +84,11 @@ function getListingQueryDirectories() {
function getListingDirectoryByQueryParent(parent : string) {
//-----this acts as a whitelist and a mapping to the folder name...
let directories : any[] = getListingQueryDirectories() ;
let directories : string[] = getListingQueryDirectories() ;
let directory : string = '';
if (typeof directories[parent] === 'undefined') {
directory = '';
} else {
if (directories.includes(parent)) {
directory = directories[parent];
}