mirror of
https://github.com/kemko/nomad.git
synced 2026-01-02 16:35:44 +03:00
21 lines
472 B
JavaScript
21 lines
472 B
JavaScript
/**
|
|
* Copyright (c) HashiCorp, Inc.
|
|
* SPDX-License-Identifier: BUSL-1.1
|
|
*/
|
|
|
|
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);
|