Sha256: bd54612e5f804ac1681af6dcef329091aed063bf227e9a3cd6dccac7d4463ebe

Contents?: true

Size: 863 Bytes

Versions: 3

Compression:

Stored size: 863 Bytes

Contents

import { InternalHelperReference } from '../utils/references';
const isEmpty = (value) => {
    return value === null || value === undefined || typeof value.toString !== 'function';
};
const normalizeTextValue = (value) => {
    if (isEmpty(value)) {
        return '';
    }
    return String(value);
};
/**
@module ember
*/
/**
  Concatenates the given arguments into a string.

  Example:

  ```handlebars
  {{some-component name=(concat firstName " " lastName)}}

  {{! would pass name="<first name value> <last name value>" to the component}}
  ```

  @public
  @method concat
  @for Ember.Templates.helpers
  @since 1.13.0
*/
function concat({ positional }) {
    return positional
        .value()
        .map(normalizeTextValue)
        .join('');
}
export default function (_vm, args) {
    return new InternalHelperReference(concat, 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/concat.js
discourse-ember-source-3.5.1.1 dist/es/ember-glimmer/lib/helpers/concat.js
discourse-ember-source-3.5.1.0 dist/dist/es/ember-glimmer/lib/helpers/concat.js