PageSourceSearch

https://www.woorisavingsbank.com/resources/common/foresys/validationUtils.js

js woorisavingsbank.com collected 2026-10-02 15:31:08 UTC 3,594 bytes, 167 lines download raw bytes

1var valid = {
2	// null & undefined & 공백 체크
3	checkNull : function(str) {
4		if(typeof str == "undefined" || str == null || str == ""){
5			return true;
6		} else{
7			return false;
8		}
9	},
10
11	// Object가 비어있을 때 true 반환
12	checkEmptyObject : function(obj) {
13		if(typeof obj == "string") {
14			obj = JSON.parse(obj);
15		}
16
17		if(Object.keys(obj).length === 0 && JSON.stringify(obj) === JSON.stringify({})){
18			return true;
19		} else{
20			return false;
21		}
22	},
23
24	// null & undefined (공백은 그냥 넘어감)
25	checkUndefined: function(str) {
26		if(typeof str == "undefined" || str == null){
27			return true;
28		} else{
29			return false;
30		}
31	},
32
33	// 값이 없거나("") 혹은 공백(" ")만 있는지 체크
34	checkEmpty : function(str) {
35		if(str == "" || str.replace(/ /gi, "") == ""){
36			return true;
37		} else{
38			return false;
39		}
40	},
41
42	// 특정 문자가 존재하는지 체크하여 해당 인덱스 리턴
43	checkContains : function(str, char) {
44		for(let i = 0; i < str.length; i++) {
45			if(char.indexOf(str.charAt(i)) != -1) {
46				return i;
47			}
48		}
49
50		return false;
51	},
52
53	// 바이트 수 반환
54	checkBytes : function(str) {
55		return str.replace(/[\0-\x7f]|([0-\u07ff]|(.))/g,"$&$1$2").length;
56	},
57
58	// 숫자 체크
59	checkNumber : function(str) {
60		if(/^[0-9]*$/.test(str) && !valid.checkNull(str)){
61			return true;
62		} else{
63			return false;
64		}
65	},
66
67	// 문자열 길이 체크
68	checkLength : function(str, length) {
69		if(str.length == length  && !valid.checkNull(str)){
70			return true;
71		} else{
72			return false;
73		}
74	},
75
76	// 한글 체크
77	checkKorean : function(str) {
78		if(/^[\uac00-\ud7a3+\u3131-\u314E+\u314F-\u3163]*$/.test(str) && !valid.checkNull(str)){
79			return true;
80		} else{
81			return false;
82		}
83	},
84
85	// 영어 체크
86	checkEnglish : function(str) {
87		if(/^[a-zA-Z]*$/.test(str) && !valid.checkNull(str)){
88			return true;
89		} else{
90			return false;
91		}
92	},
93
94	// 영어 + 숫자 체크
95	checkEnglishNum : function(str) {
96		if(/^[a-zA-Z0-9]*$/.test(str) && !valid.checkNull(str)){
97			return true;
98		} else{
99			return false;
100		}
101	},
102
103	// 전화번호 체크
104	checkTelNum : function(str) {
105		if(/^\d{2,3}-\d{3,4}-\d{4}$/.test(str)){
106			return true;
107		} else{
108			return false;
109		}
110	},
111
112	// 주민등록번호 체크
113	checkRnum : function(str) {
114		if(/^\d{6} \- [1-4]\d{6}/.test(str)){
115			return true;
116		} else{
117			return false;
118		}
119	},
120
121	// 이메일 체크
122	checkEmail : function(str) {
123		if(/^[A-Za-z0-9_\.\-]+@[A-Za-z0-9\-]+\.[A-Za-z0-9\-]+/.test(str)){
124			return true;
125		} else{
126			return false;
127		}
128	},
129
130	// 날짜 체크 yyyy-MM-dd
131	checkDateYmd : function(str) {
132		if(!valid.checkNull(str) && /^(19|20)\d{2}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[0-1])$/.test(str)){
133			if(this.validDate(str)) {
134				return true;
135			} else {
136				return false;
137			}
138		} else{
139			return false;
140		}
141	},
142
143	// 날짜 유효성 체크
144	validDate : function(str) {
145		var dtArray = str.split("-");
146		dtYear = dtArray[0]; 
147		dtMonth = dtArray[1]; 
148		dtDay = dtArray[2];
149		
150		if (dtMonth < 1 || dtMonth > 12) { 
151			return false; 
152		} 
153		else if (dtDay < 1 || dtDay > 31) { 
154			return false; 
155		} 
156		else if ((dtMonth == 4 || dtMonth == 6 || dtMonth == 9 || dtMonth == 11) && dtDay == 31) { 
157			return false; 
158		} 
159		else if (dtMonth == 2) { 
160			var isleap = (dtYear % 4 == 0 && (dtYear % 100 != 0 || dtYear % 400 == 0)); 
161			if (dtDay > 29 || (dtDay == 29 && !isleap)) {
162				return false; 
163			} 
164		} 
165		return true;
166	}
167}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.