-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathnotify.js
37 lines (35 loc) · 1.36 KB
/
notify.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
"use strict";
import { notifyWideReview } from "./notify-wide-review.js";
import * as monitor from "./lib/monitor.js";
export default
function notify(spec) {
if (spec.status === "Note"
|| spec.status === "Draft Note"
|| spec.status === "Draft Registry"
|| spec.status === "Registry"
|| spec.status === "Working Draft"
|| spec.status === "Candidate Recommendation Draft"
|| spec.status === "Candidate Recommendation Snapshot"
|| spec.status === "Candidate Registry Draft"
|| spec.status === "Candidate Registry Snapshot"
|| spec.status === "Candidate Recommendation"
|| (spec.status === "Recommendation"
&& (spec.proposedAdditions || spec.proposedCorrections))) {
if (spec.status === "Candidate Recommendation Snapshot"
|| spec.status === "Candidate Registry Snapshot"
|| (spec.status === "Recommendation" && spec.proposedCorrections)
|| spec._links["predecessor-version"] === undefined
|| spec.sotd.indexOf("wide review") !== -1) {
notifyWideReview(spec);
} else {
// else ignore
monitor.log(`${spec.uri} isn't up for wide review`);
}
} else if (spec.status === "Proposed Recommendation"
|| spec.status === "Recommendation") {
monitor.log(`${spec.uri} is too late for wide review`);
} else {
// better safe than sorry
notifyWideReview(spec);
}
}