MCPcopy Index your code
hub / github.com/totaljs/framework / ls

Function ls

utils.js:2926–2947  ·  view source on GitHub ↗
(path, callback, advanced, filter)

Source from the content-addressed store, hash-verified

2924};
2925
2926function ls(path, callback, advanced, filter) {
2927 var filelist = new FileList();
2928 var tmp;
2929
2930 filelist.advanced = advanced;
2931 filelist.onComplete = callback;
2932
2933 if (typeof(filter) === 'string') {
2934 tmp = filter.toLowerCase();
2935 filelist.onFilter = function(filename, is) {
2936 return is ? true : filename.toLowerCase().indexOf(tmp) !== -1;
2937 };
2938 } else if (exports.isRegExp(filter)) {
2939 tmp = filter;
2940 filelist.onFilter = function(filename, is) {
2941 return is ? true : tmp.test(filename);
2942 };
2943 } else
2944 filelist.onFilter = filter || null;
2945
2946 filelist.walk(path);
2947}
2948
2949/**
2950 * Directory listing

Callers 1

utils.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected