1
+ /**
2
+ * @import {ElmJson} from './types/content';
3
+ * @import {Options} from './types/options';
4
+ * @import {VersionString} from './types/version';
5
+ */
6
+
1
7
const ProjectJsonFiles = require ( './project-json-files' ) ;
2
8
9
+ /**
10
+ * @param {Options } options
11
+ * @param {ElmJson } elmJson
12
+ * @param {VersionString } elmVersion
13
+ */
3
14
async function collect ( options , elmJson , elmVersion ) {
4
15
const dependenciesEntries =
5
16
elmJson . type === 'application'
@@ -19,7 +30,9 @@ async function collect(options, elmJson, elmVersion) {
19
30
20
31
const projectDepsPromises = Object . entries ( dependenciesEntries ) . map (
21
32
async ( [ name , constraint ] ) => {
22
- const packageVersion = constraint . split ( ' ' ) [ 0 ] ;
33
+ const packageVersion = /** @type {VersionString } */ (
34
+ constraint . split ( ' ' ) [ 0 ]
35
+ ) ;
23
36
24
37
const [ docsJson , dependencyElmJson ] = await Promise . all ( [
25
38
ProjectJsonFiles . getDocsJson (
@@ -66,6 +79,10 @@ I will try to review the project anyway, but you might get unexpected results…
66
79
return projectDeps ;
67
80
}
68
81
82
+ /**
83
+ * @param {string } name
84
+ * @param {VersionString } packageVersion
85
+ */
69
86
function defaultElmJson ( name , packageVersion ) {
70
87
return {
71
88
type : 'package' ,
0 commit comments