Last active
January 8, 2018 00:25
-
-
Save blrobin2/be95bfe2c80e0b1ff32412c4dba35f7b to your computer and use it in GitHub Desktop.
My version of build string by @peterpme
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
const buildString = (delimeter: string, ...collection: any[]): string => | |
collection.filter(Boolean).join(delimeter); | |
console.log(buildString('/', 'api', undefined, 'users', 123)); // 'api/users/123' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment