Fixed Codacy issues
Also added specification link in JSON files
This commit is contained in:
@ -38,8 +38,11 @@ let snippetData = {
|
|||||||
archived: false,
|
archived: false,
|
||||||
hash: util.hashData(snippets[key])
|
hash: util.hashData(snippets[key])
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
})
|
}),
|
||||||
|
meta: {
|
||||||
|
specification: 'http://jsonapi.org/format/'
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// Extract archived snippet data
|
// Extract archived snippet data
|
||||||
let snippetArchiveData = {
|
let snippetArchiveData = {
|
||||||
@ -57,8 +60,11 @@ let snippetArchiveData = {
|
|||||||
archived: true,
|
archived: true,
|
||||||
hash: util.hashData(archivedSnippets[key])
|
hash: util.hashData(archivedSnippets[key])
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
})
|
}),
|
||||||
|
meta: {
|
||||||
|
specification: 'http://jsonapi.org/format/'
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// Write files
|
// Write files
|
||||||
fs.writeFileSync(path.join(OUTPUT_PATH, 'snippets.json'), JSON.stringify(snippetData, null, 2));
|
fs.writeFileSync(path.join(OUTPUT_PATH, 'snippets.json'), JSON.stringify(snippetData, null, 2));
|
||||||
|
|||||||
@ -89,10 +89,10 @@ const getCodeBlocks = str => {
|
|||||||
}
|
}
|
||||||
m.forEach((match, groupIndex) => {
|
m.forEach((match, groupIndex) => {
|
||||||
results.push(match);
|
results.push(match);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
return results;
|
return results;
|
||||||
}
|
};
|
||||||
// Gets the textual content for a snippet file.
|
// Gets the textual content for a snippet file.
|
||||||
const getTextualContent = str => {
|
const getTextualContent = str => {
|
||||||
const regex = /###.*\n*([\s\S]*?)```/g;
|
const regex = /###.*\n*([\s\S]*?)```/g;
|
||||||
@ -104,8 +104,8 @@ const getTextualContent = str => {
|
|||||||
}
|
}
|
||||||
m.forEach((match, groupIndex) => {
|
m.forEach((match, groupIndex) => {
|
||||||
results.push(match);
|
results.push(match);
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
return results[1];
|
return results[1];
|
||||||
}
|
};
|
||||||
module.exports = {readSnippets, readTags, optimizeNodes, capitalize, objectFromPairs, isTravisCI, hashData, shuffle, getCodeBlocks, getTextualContent};
|
module.exports = {readSnippets, readTags, optimizeNodes, capitalize, objectFromPairs, isTravisCI, hashData, shuffle, getCodeBlocks, getTextualContent};
|
||||||
|
|||||||
@ -6036,5 +6036,8 @@
|
|||||||
"hash": "7cb99869abe8e7ff857b7876fd00cb9ebad3d97b0262845365ed7f75350c10e7"
|
"hash": "7cb99869abe8e7ff857b7876fd00cb9ebad3d97b0262845365ed7f75350c10e7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"meta": {
|
||||||
|
"specification": "http://jsonapi.org/format/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -357,5 +357,8 @@
|
|||||||
"hash": "b556b1d2bb7b2dc2c42f8b7c4d63f9fb80a6685ca742029f26c1575fb8aa4649"
|
"hash": "b556b1d2bb7b2dc2c42f8b7c4d63f9fb80a6685ca742029f26c1575fb8aa4649"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"meta": {
|
||||||
|
"specification": "http://jsonapi.org/format/"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user