Sha256: abb6dc278a7af9c7612f1837fd7eb2cec6655a13bc0699c6ebeea6d7c72d4a7a

Contents?: true

Size: 635 Bytes

Versions: 3

Compression:

Stored size: 635 Bytes

Contents

import { dasherize } from '@ember/string';
import { InternalHelperReference } from '../utils/references';
function normalizeClass({ positional }) {
    let classNameParts = positional
        .at(0)
        .value()
        .split('.');
    let className = classNameParts[classNameParts.length - 1];
    let value = positional.at(1).value();
    if (value === true) {
        return dasherize(className);
    }
    else if (!value && value !== 0) {
        return '';
    }
    else {
        return String(value);
    }
}
export default function (_vm, args) {
    return new InternalHelperReference(normalizeClass, args.capture());
}

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
discourse-ember-source-3.6.0.0 dist/es/@ember/-internals/glimmer/lib/helpers/-normalize-class.js
discourse-ember-source-3.5.1.1 dist/es/ember-glimmer/lib/helpers/-normalize-class.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-glimmer/lib/helpers/-normalize-class.js