-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #373 from bapplejax/simplify-header-footer
Simplifying header and footer to use data
- Loading branch information
Showing
5 changed files
with
147 additions
and
135 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { lowercaseHyphenateString } from './helpers'; | ||
|
||
describe('Generic Helper Functions', () => { | ||
test('should use lowercaseHyphenateString to format a string to be lowercase and hyphenated', () => { | ||
const testText = lowercaseHyphenateString('A link wiTh strANge Spaces '); | ||
|
||
expect(testText).toEqual('a-link-with-strange-spaces'); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// Utility function to format string | ||
export const lowercaseHyphenateString = (dirtyString: string) => { | ||
const cleanString = dirtyString.trim().replace(/\s/g, '-').toLowerCase(); | ||
|
||
return cleanString; | ||
}; |