image sync

This commit is contained in:
azivner
2018-01-06 15:56:00 -05:00
parent 91cf090820
commit 784cd62df1
10 changed files with 201 additions and 56 deletions

View File

@@ -79,6 +79,14 @@ function sanitizeSql(str) {
return str.replace(/'/g, "\\'");
}
function assertArguments() {
for (const i in arguments) {
if (!arguments[i]) {
throw new Error(`Argument idx#${i} should not be falsy: ${arguments[i]}`);
}
}
}
module.exports = {
randomSecureToken,
randomString,
@@ -95,5 +103,6 @@ module.exports = {
hash,
isEmptyOrWhitespace,
getDateTimeForFile,
sanitizeSql
sanitizeSql,
assertArguments
};