open-nomad/ui/app/helpers/css-class.js
Phil Renaud 311a6d82c9
Importing string methods directly from @ember/string (#12499)
* Capitalize methods

* Let ESLint yell at us again

* Dasherize
2022-04-07 15:51:41 -04:00

16 lines
393 B
JavaScript

import { helper } from '@ember/component/helper';
import { dasherize } from '@ember/string';
/**
* CSS Class
*
* Usage: {{css-class updateType}}
*
* Outputs a css friendly class string from any human string.
* Differs from dasherize by handling slashes.
*/
export function cssClass([updateType]) {
return dasherize(updateType.replace(/\//g, '-'));
}
export default helper(cssClass);