diff --git a/lib/auth.js b/lib/auth.js index 818c2507..c8f65d45 100644 --- a/lib/auth.js +++ b/lib/auth.js @@ -65,14 +65,16 @@ const passwordTests = { options: { number: 2 }, }, MIN_LOWERCASE_CHARS: { - test: (password, option) => - stringIncludesChars(password, unicodeCategories.Ll, option.number), + test: (password, option) => stringIncludesChars( + password, unicodeCategories.Ll, option.number + ), hint: options => ({ name: 'MIN_LOWERCASE_CHARS', number: options.number }), options: { number: 1 }, }, MIN_UPPERCASE_CHARS: { - test: (password, options) => - stringIncludesChars(password, unicodeCategories.Lu, options.number), + test: (password, options) => stringIncludesChars( + password, unicodeCategories.Lu, options.number + ), hint: options => ({ name: 'MIN_UPPERCASE_CHARS', number: options.number }), options: { number: 1 }, }, diff --git a/lib/strings.js b/lib/strings.js index f4a48c55..7b86632b 100644 --- a/lib/strings.js +++ b/lib/strings.js @@ -21,8 +21,10 @@ const ALPHA_DIGIT = ALPHA + DIGIT; // content - string, to escape // Returns: string // Example: htmlEscape('5>=5') = '5<=5' -const htmlEscape = content => - content.replace(HTML_ESCAPE_REGEXP, char => HTML_ESCAPE_CHARS[char]); +const htmlEscape = content => content.replace( + HTML_ESCAPE_REGEXP, + char => HTML_ESCAPE_CHARS[char] +); const subst = ( // Substitute variables @@ -91,8 +93,8 @@ const subst = ( // Returns: string // Example: fileExt('/dir/file.txt') // Result: 'txt' -const fileExt = fileName => - path.extname(fileName).replace('.', '').toLowerCase(); +const fileExt = fileName => path.extname(fileName) + .replace('.', '').toLowerCase(); // Remove file extension from file name // fileName - string, file name @@ -106,10 +108,10 @@ const CAPITALIZE_REGEXP = /\w+/g; // Capitalize string // s - string // Returns: string -const capitalize = s => - s.replace(CAPITALIZE_REGEXP, word => - word.charAt(0).toUpperCase() + word.substr(1).toLowerCase() - ); +const capitalize = s => s.replace( + CAPITALIZE_REGEXP, + word => word.charAt(0).toUpperCase() + word.substr(1).toLowerCase() +); const UNDERLINE_REGEXP = /_/g; diff --git a/lib/utilities.js b/lib/utilities.js index 8680f432..6a33bdf2 100644 --- a/lib/utilities.js +++ b/lib/utilities.js @@ -77,8 +77,9 @@ const callerFilepath = (depth = 0, stack = null) => { return ''; }; -const callerFilename = - (depth = 0, stack = null) => basename(callerFilepath(depth + 1, stack) || ''); +const callerFilename = (depth = 0, stack = null) => basename( + callerFilepath(depth + 1, stack) || '' +); module.exports = { deprecate,