Last active
May 4, 2016 10:28
-
-
Save stefanosaittamrf/f5e2b671465fc11795dfc1a369f94a1a 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
//I write this down in order to remove hardcoded link into a whiteCollar/main.js | |
const noSubDomainRegex = /^http(s)?:\/\/(?:www\.)[a-z1-9]+.[a-z]\/?[a-zA-Z0-9_?=&\/\-.]+$/; //K cost, no performance issue | |
!noSubDomainRegex.test(item.uri) ? return null : return item; // this will cost N where n is the length of the string | |
// the cost of this is O(K*n) => O(n)* | |
//* for a big N. Can be considered as constant for a small N. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment