mirror of
https://github.com/LaconicNetwork/laconic.com.git
synced 2026-01-17 15:54:09 +00:00
Signed-off-by: Traxus <shyidx@gmail.com>
This commit is contained in:
parent
8fc8ebac4d
commit
8a1a291b2e
@ -24,7 +24,7 @@ function datocmsDateToIng(date : string) : number {
|
||||
|
||||
|
||||
//-----graphql query interception
|
||||
export async function datocmsQueryIntercept(query : any) : Promise<object> {
|
||||
export async function datocmsQueryIntercept(query : any) {
|
||||
let parent = pluckFirstParentFromQuery(query);
|
||||
let pageQueryWhitelist = getPageQueryBypassWhitelist();
|
||||
let listingQueryWhitelist = getListingQueryDirectories();
|
||||
@ -89,14 +89,14 @@ function pluckFirstParentFromQuery(query : any) : string {
|
||||
|
||||
}
|
||||
|
||||
async function datocmsPageQueryIntercept(query : any) : Promise<object> {
|
||||
async function datocmsPageQueryIntercept(query : any) {
|
||||
|
||||
let parent : string = pluckFirstParentFromQuery(query);
|
||||
let jsonDirectory : string = path.join(process.cwd(), 'json/site_content');
|
||||
let jsonPath : string = jsonDirectory + '/' + parent + '.json';
|
||||
let fileRawContents : string = '';
|
||||
let fileJson : object = {}
|
||||
let jsonData : object = {}
|
||||
let jsonData : any = {}
|
||||
|
||||
try {
|
||||
fileRawContents = await fs.readFile(jsonPath, 'utf8');
|
||||
@ -114,10 +114,10 @@ async function datocmsPageQueryIntercept(query : any) : Promise<object> {
|
||||
|
||||
}
|
||||
|
||||
async function datocmsListingQueryIntercept(query : any) : Promise<object> {
|
||||
async function datocmsListingQueryIntercept(query : any) {
|
||||
|
||||
let parent : string = pluckFirstParentFromQuery(query);
|
||||
let jsonData : object = {};
|
||||
let jsonData : any = {};
|
||||
|
||||
switch(parent) {
|
||||
case 'allBlogPosts':
|
||||
@ -223,7 +223,7 @@ function jsonNodesExist(jsonData : object, nodes : array) {
|
||||
|
||||
}
|
||||
|
||||
export async function getJsonItemsFromDirectory(jsonDirectory : string, pluckerFunction : object, validationNodes : array) {
|
||||
export async function getJsonItemsFromDirectory(jsonDirectory : string, pluckerFunction : any, validationNodes : array) {
|
||||
let jsonFiles = await fs.readdir(jsonDirectory);
|
||||
let returnJson = [];
|
||||
|
||||
@ -279,7 +279,7 @@ function pluckBlogPostData(json : object) {
|
||||
|
||||
}
|
||||
|
||||
function getRequiedBlogPostNodes() {
|
||||
function getRequiedBlogPostNodes() : string[] {
|
||||
|
||||
let nodes = [];
|
||||
let contentNodes = [];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user