MCPcopy Index your code
hub / github.com/everkinetic/data / getContent

Function getContent

scripts/util.js:27–43  ·  view source on GitHub ↗
(folder, type)

Source from the content-addressed store, hash-verified

25}
26
27function getContent(folder, type) {
28 return _.chain(fs.readdirSync(folder))
29 .filter(function (file) {
30 // ignore dot files/folders
31 if (file.indexOf('.') === 0) return;
32 var stats = fs.statSync(pt.join(folder, file));
33 if (type === 'folder' && stats.isDirectory()) return true;
34 if (type !== 'folder' && !stats.isDirectory()) return true;
35 })
36 .map(function (file) {
37 return _.extend({
38 name: file,
39 path: pt.join(folder, file)
40 }, type === 'folder' ? {} : { extension: _.last(file.split('.')) });
41 })
42 .value()
43}
44
45
46module.exports = util = {

Callers 1

util.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected