<commit_before>const errorCodeMap = {
    ERROR_UNKNOWN: 0,
    ERROR_MISSING_PARAM: -1,
    ERROR_INVALID_PARAM: -2,
    ERROR_DUPLICATE: -3,
    ERROR_INVALID_ACCESS_TOKEN: -4,
    ERROR_NO_CONNECTION: -5
};

// undefined 체크
exports.undefinedCheck = v => v === undefined ? false : true;

// JSON Valid check
exports.jsonValidation = data => {
    try {
        return JSON.parse(data);
    }
    catch (e) {
        return false;
    }
};

// 200 - success
exports.success200 = res => res.status(200).json({});

// 200 - return Model
exports.success200RetObj = (res, obj) => res.status(200).json(obj);

// No Data
exports.successNoData = res => res.status(200).json({});

// 201 - create
exports.success201 = res => res.status(201).json({});

// 204 - delete
exports.success204 = res => res.status(204).send();

// 400 - 인자값 누락
exports.error400InvalidCall = (res, errorCode, data) => res.status(400).json({
    errorCode: errorCodeMap[errorCode],
    data: data
});

// 401 - 리소스 접근권한 없음
exports.error401Unauthorized = res => res.status(401).json({});

// 403- 리소스 접근권한 만료
exports.error403Expired = res => res.status(403).json({});

exports.error404NotFound = res => res.status(404).json({});

// 500 - 서버 error
exports.error500Server = (res, err) => res.status(500).json(err);

exports.errorInvalidAccessToken = res => res.status(400).json({
    errorCode: errorCodeMap['ERROR_INVALID_ACCESS_TOKEN']
});

// 비밀번호 틀릴 때
exports.errorInvalidHash = res => res.status(401).json({});

// No Device
exports.errorNoDevice = res => res.status(404).json({});

// No User
exports.errorNoUser = res => res.status(401).json({});<commit_msg>결과 메시지 메서드 수정<commit_after>const errorCodeMap = {
    ERROR_UNKNOWN: 0,
    ERROR_MISSING_PARAM: -1,
    ERROR_INVALID_PARAM: -2,
    ERROR_DUPLICATE: -3,
    ERROR_INVALID_ACCESS_TOKEN: -4,
    ERROR_NO_CONNECTION: -5
};

// undefined 체크
exports.undefinedCheck = v => v === undefined ? false : true;

// JSON Valid check
exports.jsonValidation = data => {
    try {
        return JSON.parse(data);
    }
    catch (e) {
        return false;
    }
};

// 200 - success
exports.success200 = res => res.status(200).json({});

// 200 - return Model
exports.success200RetObj = (res, obj) => res.status(200).json(obj);

// No Data
exports.successNoData = res => res.status(200).json({});

// 201 - create
exports.success201 = res => res.status(201).json({});

// 204 - delete
exports.success204 = res => res.status(204).send();

// 400 - 인자값 누락
exports.error400InvalidCall = (res, errorCode, data) => res.status(400).json({
    errorCode: errorCodeMap[errorCode],
    data: data
});

// 401 - 리소스 접근권한 없음
exports.error401Unauthorized = res => res.status(401).send();

// 403- 리소스 접근권한 만료
exports.error403Expired = res => res.status(403).send();

exports.error404NotFound = res => res.status(404).send();

// 500 - 서버 error
exports.error500Server = (res, err) => res.status(500).json(err);

exports.errorInvalidAccessToken = res => res.status(400).json({
    errorCode: errorCodeMap['ERROR_INVALID_ACCESS_TOKEN']
});
{'fraction_non_alphanumeric': 0.16929651545036162, 'fraction_numerical': 0.0621301775147929, 'mean_word_length': 3.5485799701046337, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6263105', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1157, 'n_words': 222}