-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsupport.js
More file actions
32 lines (30 loc) · 900 Bytes
/
support.js
File metadata and controls
32 lines (30 loc) · 900 Bytes
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
module.exports ={
regExp : {
removeComment : new RegExp(/\/\*[\s\S]*?\*\/|\/\/.*/g),
checkKorean : new RegExp(/[가-힣]/)
},
removeComment(str) {
return str.replace(this.regExp.removeComment, '');
},
toArray(str) {
return str.split('\n');
},
checkLiteral(str) {
if((this.regExp.checkKorean).test(str)) return true;
return false;
},
booleanArr(len) {
let tmpList = new Array(len);
tmpList.fill(false);
return tmpList;
},
createErrorList(path, list, errorIdx) {
let tmpList = [(path)];
errorIdx.forEach((element, idx) => {
element ? tmpList.push(`${idx} : `+list[idx]) : '';
});
tmpList.push('=============================================================================');
// console.log(tmpList);
return tmpList;
}
};