-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmetrics.js
47 lines (44 loc) · 1.23 KB
/
metrics.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// LICENSE
// This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not
// distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// END LICENSE
//@ts-check
(
/**
*
* @param { slime.$api.Global } $api
* @param { slime.loader.Export<slime.tools.code.metrics.Settings> } $export
*/
function($api,jsh,$export) {
var excludes = {
descend: function(directory) {
var basename = jsh.file.Location.basename(directory);
if (basename == ".git") return false;
if (basename == "local") return false;
// TODO SLIME-specfic use of bin
if (basename == "bin") return false;
return true;
},
isSource: function(file) {
// TODO SLIME-specfic use of jsh.project.code
return $api.fp.Maybe.from.some(jsh.project.code.files.isText({
path: void(0),
file: file
}));
}
};
var settings = function() {
return {
excludes: excludes,
isGenerated: function(file) {
if (file.path == "rhino/tools/docker/tools/docker-api.d.ts") return true;
if (file.path == "rhino/tools/github/tools/github-rest.d.ts") return true;
return false;
}
}
}
$export(settings());
}
//@ts-ignore
)($api,jsh,$export);