This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.validator.addMethod('SocialSecurity', | |
function (value) { | |
return validSSN(value) || value == ""; | |
}, 'Please enter a valid SSN' | |
); | |
function validSSN(value) { | |
var regex = /^([0-6]\d{2}|7[0-6]\d|77[0-2])([ \-]?)(\d{2})\2(\d{4})$/; | |
if (!regex.test(value)) { | |
return false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function cleanEmptyFoldersRecursively(folder) { | |
var fs = require('fs'); | |
var path = require('path'); | |
var isDir = fs.statSync(folder).isDirectory(); | |
if (!isDir) { | |
return; | |
} | |
var files = fs.readdirSync(folder); |