github.com/hernad/nomad@v1.6.112/ui/app/helpers/css-class.js (about) 1 /** 2 * Copyright (c) HashiCorp, Inc. 3 * SPDX-License-Identifier: MPL-2.0 4 */ 5 6 import { helper } from '@ember/component/helper'; 7 import { dasherize } from '@ember/string'; 8 /** 9 * CSS Class 10 * 11 * Usage: {{css-class updateType}} 12 * 13 * Outputs a css friendly class string from any human string. 14 * Differs from dasherize by handling slashes. 15 */ 16 export function cssClass([updateType]) { 17 return dasherize(updateType.replace(/\//g, '-')); 18 } 19 20 export default helper(cssClass);