mirror of
https://github.com/LaconicNetwork/laconic.com.git
synced 2026-05-04 04:14:16 +00:00
Signed-off-by: Traxus <shyidx@gmail.com>
This commit is contained in:
parent
cd9ab2e2e6
commit
059f91dc59
@ -182,7 +182,7 @@ function jsonNodesExist(jsonData : any, nodes : any) {
|
||||
let nodeGroupNode = ''
|
||||
let nodeGroupValid = false
|
||||
|
||||
for (let i = 0 i < nodes.length i++) {
|
||||
for (i = 0 i < nodes.length i++) {
|
||||
node = nodes[i]
|
||||
if (typeof node === 'string') {
|
||||
//-----string means that PRIMARY node must exist... no checking for children etc...
|
||||
@ -193,7 +193,7 @@ function jsonNodesExist(jsonData : any, nodes : any) {
|
||||
//-----array means json is valid if ANY of the nodes in that array exist
|
||||
nodeGroup = node
|
||||
nodeGroupValid = false
|
||||
for (let j = 0 j < nodeGroup.length j++) {
|
||||
for (j = 0 j < nodeGroup.length j++) {
|
||||
nodeGroupNode = nodeGroup[j]
|
||||
if (jsonNodeExists(jsonData, nodeGroupNode) === true) {
|
||||
nodeGroupValid = true
|
||||
@ -216,7 +216,7 @@ export async function getJsonItemsFromDirectory(jsonDirectory : string, pluckerF
|
||||
let jsonFiles = await fs.readdir(jsonDirectory)
|
||||
let returnJson : any[] = []
|
||||
|
||||
for (let i = 0 i < jsonFiles.length i++) {
|
||||
for (i = 0 i < jsonFiles.length i++) {
|
||||
let jsonFile = jsonFiles[i]
|
||||
if (jsonFilePathIsValid(jsonFile) === true) {
|
||||
let jsonPath = path.join(jsonDirectory, jsonFile)
|
||||
@ -290,7 +290,7 @@ function forceBlogPostsJsonSlugIntegrity(json : any[]) {
|
||||
|
||||
let returnJson : any[] = []
|
||||
|
||||
for (let i = 0 i < json.length i++) {
|
||||
for (i = 0 i < json.length i++) {
|
||||
let blogPost = json[i]
|
||||
let sourceFile = blogPost.sourceFile
|
||||
let newSlug = path.parse(sourceFile).name
|
||||
@ -340,7 +340,7 @@ export async function getAllBlogPostsSlugsFromSource() {
|
||||
let jsonFiles = await fs.readdir(jsonDirectory)
|
||||
let slugs = []
|
||||
|
||||
for (let i = 0 i < jsonFiles.length i++) {
|
||||
for (i = 0 i < jsonFiles.length i++) {
|
||||
let jsonFile = jsonFiles[i]
|
||||
if (jsonFilePathIsValid(jsonFile) === true) {
|
||||
let slug = path.parse(jsonFile).name
|
||||
@ -410,7 +410,7 @@ function getBlogPostCategorySlugs(blogPostJson : any) {
|
||||
|
||||
try {
|
||||
let categoryNode = blogPostJson.category
|
||||
for (let i = 0 i < categoryNode.length i++) {
|
||||
for (i = 0 i < categoryNode.length i++) {
|
||||
let category = categoryNode[i].slug
|
||||
categories.push(category)
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user