|
|
|
|
@ -194,7 +194,27 @@ $(document).ready(function () {
|
|
|
|
|
* @returns {boolean}
|
|
|
|
|
*/
|
|
|
|
|
function isEmpty(value) {
|
|
|
|
|
var isEmptyObject = function(a) {
|
|
|
|
|
|
|
|
|
|
if (value === null || value === undefined) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (typeof value === 'string' && value.trim() === '') {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Array.isArray(value) && value.length === 0) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (typeof value === 'object' && Object.keys(value).length === 0) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
기존소스 주석. 0 true 가 이닌 false 처리
|
|
|
|
|
var isEmptyObject = function(a) {
|
|
|
|
|
if(typeof a.length === 'undefined') { // it's an Object, not an Array
|
|
|
|
|
var hasNonempty = Object.keys(a).some(function nonEmpty(element) {
|
|
|
|
|
return !isEmpty(a[element]);
|
|
|
|
|
@ -208,6 +228,7 @@ function isEmpty(value) {
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
return(value == false || typeof value === 'undefined' || value == null || (typeof value === 'object' && isEmptyObject(value)));
|
|
|
|
|
*/
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* null 이나 빈값을 기본값으로 변경
|
|
|
|
|
|