-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwrapper.js
60 lines (54 loc) · 3.1 KB
/
wrapper.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
48
49
50
51
52
53
54
55
56
57
58
59
60
// This file wraps our internal functions for tC Create and the Content Validation App
// and other unfoldingWord tools to use more easily
//
// NOTE: We also remove disabled notices before returning these results
//
// These wrapper functions were requested by Cecil New in October 2021
//
import { checkNotesTSV7Table } from './notes-tsv7-table-check';
import { internalCheckTN_TSV9Table } from './tn-tsv9-table-check';
import { checkQuestionsTSV7Table } from './questions-tsv7-table-check';
import { internalCheckTWL_TSV6Table } from './twl-tsv6-table-check';
import { removeDisabledNotices } from './disabled-notices';
// NOTE: We don't need to know the org name or the repo name here
// because if we check linked articles, the function to do this will be provided in checkingOptions
export async function checkTN_TSV7Table(username, languageCode, bookID, tableText, checkingOptions) {
// Note: the filename and givenLocation parameters are left blank
let checkResults = await checkNotesTSV7Table(username, languageCode, 'TN', bookID, '', tableText, '', {...checkingOptions, suppressNoticeDisablingFlag: false});
if (!checkingOptions?.suppressNoticeDisablingFlag) {
checkResults.noticeList = removeDisabledNotices(checkResults.noticeList);
}
return checkResults;
}
export async function checkTN_TSV9Table(username, languageCode, bookID, tableText, checkingOptions) {
// Note: the filename and givenLocation parameters are left blank
let checkResults = await internalCheckTN_TSV9Table(username, languageCode, 'TN', bookID, '', tableText, '', {...checkingOptions, suppressNoticeDisablingFlag: false});
if (!checkingOptions?.suppressNoticeDisablingFlag) {
checkResults.noticeList = removeDisabledNotices(checkResults.noticeList);
}
return checkResults;
}
export async function checkSQ_TSV7Table(username, languageCode, bookID, tableText, checkingOptions) {
// Note: the filename and givenLocation parameters are left blank
let checkResults = await checkQuestionsTSV7Table(username, languageCode, 'SQ', bookID, '', tableText, '', checkingOptions)
if (!checkingOptions?.suppressNoticeDisablingFlag) {
checkResults.noticeList = removeDisabledNotices(checkResults.noticeList);
}
return checkResults;
}
export async function checkTQ_TSV7Table(username, languageCode, bookID, tableText, checkingOptions) {
// Note: the filename and givenLocation parameters are left blank
let checkResults = await checkQuestionsTSV7Table(username, languageCode, 'TQ', bookID, '', tableText, '', checkingOptions)
if (!checkingOptions?.suppressNoticeDisablingFlag) {
checkResults.noticeList = removeDisabledNotices(checkResults.noticeList);
}
return checkResults;
}
export async function checkTWL_TSV6Table(username, languageCode, bookID, tableText, checkingOptions) {
// Note: the filename and givenLocation parameters are left blank
let checkResults = await internalCheckTWL_TSV6Table(username, languageCode, 'TWL', bookID, '', tableText, '', checkingOptions)
if (!checkingOptions?.suppressNoticeDisablingFlag) {
checkResults.noticeList = removeDisabledNotices(checkResults.noticeList);
}
return checkResults;
}