@elevate_security/customer-data-validators
Advanced tools
Comparing version 0.1.9 to 0.2.0
@@ -120,3 +120,3 @@ #!/usr/bin/env node | ||
} | ||
}, _callee, null, [[0, 25]]); | ||
}, _callee, this, [[0, 25]]); | ||
}))(); |
@@ -59,3 +59,3 @@ "use strict"; | ||
} | ||
}, _callee); | ||
}, _callee, this); | ||
})); | ||
@@ -62,0 +62,0 @@ return _CSVExporter.apply(this, arguments); |
@@ -28,3 +28,3 @@ "use strict"; | ||
case 0: | ||
checkHeaders = function _ref8(fields) { | ||
checkHeaders = function checkHeaders(fields) { | ||
var reject_additional_headers = config.reject_additional_headers === true; | ||
@@ -48,3 +48,3 @@ Object.keys(config.headers).filter(function (h) { | ||
checkConstraints = function _ref7(row) { | ||
checkConstraints = function checkConstraints(row) { | ||
var lineErrors = []; | ||
@@ -67,3 +67,3 @@ | ||
checkTypes = function _ref6(row) { | ||
checkTypes = function checkTypes(row) { | ||
var lineErrors = []; | ||
@@ -86,3 +86,3 @@ Object.keys(config.headers).filter(function (h) { | ||
checkForBlankValues = function _ref5(row) { | ||
checkForBlankValues = function checkForBlankValues(row) { | ||
var lineErrors = []; | ||
@@ -99,7 +99,7 @@ Object.keys(config.headers).filter(function (h) { | ||
checkForRowErrors = function _ref4(row) { | ||
checkForRowErrors = function checkForRowErrors(row) { | ||
return checkUniqueValues(row).concat(checkForBlankValues(row), checkTypes(row), checkConstraints(row)); | ||
}; | ||
checkUniqueValues = function _ref3(row) { | ||
checkUniqueValues = function checkUniqueValues(row) { | ||
var lineErrors = []; | ||
@@ -115,3 +115,3 @@ uniqueIndexes.forEach(function (idx) { | ||
addErrors = function _ref2(errorList) { | ||
addErrors = function addErrors(errorList) { | ||
errorList.forEach(function (e) { | ||
@@ -123,3 +123,3 @@ return errors.push(e); | ||
addError = function _ref(type, code, message) { | ||
addError = function addError(type, code, message) { | ||
var row = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0; | ||
@@ -193,3 +193,3 @@ errors.push(DataError(type, code, message, row)); | ||
} | ||
}, _callee); | ||
}, _callee, this); | ||
})); | ||
@@ -196,0 +196,0 @@ return _CSVFileValidator.apply(this, arguments); |
@@ -11,3 +11,8 @@ "use strict"; | ||
exports.CustomerDataValidator = CustomerDataValidator; | ||
exports.CSVBuilder = CSVBuilder; | ||
Object.defineProperty(exports, "CSVExporter", { | ||
enumerable: true, | ||
get: function get() { | ||
return _CSVUIexporter["default"]; | ||
} | ||
}); | ||
@@ -24,6 +29,2 @@ var _CSVUIexporter = _interopRequireDefault(require("./CSVUIexporter")); | ||
return CSVDataSetValidator(content, typeConfigs[type]); | ||
} | ||
function CSVBuilder(content) { | ||
return (0, _CSVUIexporter["default"])(content); | ||
} |
@@ -79,3 +79,3 @@ "use strict"; | ||
} | ||
}, _callee); | ||
}, _callee, this); | ||
}))); | ||
@@ -135,3 +135,3 @@ test('checks unique columns', | ||
} | ||
}, _callee2); | ||
}, _callee2, this); | ||
}))); | ||
@@ -190,3 +190,3 @@ test('accept additional columns if config permits', | ||
} | ||
}, _callee3); | ||
}, _callee3, this); | ||
}))); | ||
@@ -259,3 +259,3 @@ test('checks mandatory headers', | ||
} | ||
}, _callee4); | ||
}, _callee4, this); | ||
}))); | ||
@@ -306,3 +306,3 @@ test('not_blank', | ||
} | ||
}, _callee5); | ||
}, _callee5, this); | ||
}))); | ||
@@ -361,3 +361,3 @@ test('boolean values', | ||
} | ||
}, _callee6); | ||
}, _callee6, this); | ||
}))); | ||
@@ -422,3 +422,3 @@ test('date values', | ||
} | ||
}, _callee7); | ||
}, _callee7, this); | ||
}))); | ||
@@ -465,3 +465,3 @@ test('timestamp values', | ||
} | ||
}, _callee8); | ||
}, _callee8, this); | ||
}))); | ||
@@ -509,3 +509,3 @@ test('check "at least one of" constraint', | ||
} | ||
}, _callee9); | ||
}, _callee9, this); | ||
}))); | ||
@@ -555,3 +555,3 @@ test('check enum type', | ||
} | ||
}, _callee10); | ||
}, _callee10, this); | ||
}))); |
{ | ||
"name": "@elevate_security/customer-data-validators", | ||
"version": "0.1.9", | ||
"version": "0.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
73141
1069