Created
March 2, 2017 03:43
-
-
Save egoing/eef281df71e319d982dc8dbee17baf65 to your computer and use it in GitHub Desktop.
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 uniqify(target){ | |
var cleaned = target.replace(/(^[ \t]*\n)/gm, ""); | |
var cleanedArr = cleaned.split('\n'); | |
var uniqued = cleanedArr.filter(function(item, pos) { | |
return cleanedArr.indexOf(item) == pos; | |
}); | |
return uniqued.join('\n'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment