mirror of
https://github.com/DOI-DO/j40-cejst-2.git
synced 2025-02-24 10:34:18 -08:00
17 lines
402 B
JavaScript
17 lines
402 B
JavaScript
|
// Helper functions that need to be shared between both the src codebase
|
||
|
// and the cypress tests
|
||
|
|
||
|
/**
|
||
|
* This function will take a string and hyphenize it.
|
||
|
* For example:
|
||
|
* Whitehouse.gov => whitehouse-gov
|
||
|
* Privacy Policy => privacy-policy
|
||
|
*
|
||
|
* @param {string} string
|
||
|
* @return {string}
|
||
|
*/
|
||
|
export const hyphenizeString = (string) => {
|
||
|
return string.split(/\.| /).join('-').toLowerCase();
|
||
|
};
|
||
|
|