How to use the @ember/string.capitalize function in @ember/string

To help you get started, we’ve selected a few @ember/string examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / ember__string / ember__string-tests.ts View on Github external
decamelize('', ''); // $ExpectError

underscore(); // $ExpectError
underscore('blue man group'); // $ExpectType string
underscore('', ''); // $ExpectError

w(); // $ExpectError
w('blue man group'); // $ExpectType string[]
w('', ''); // $ExpectError

classify(); // $ExpectError
classify('blue man group'); // $ExpectType string
classify('', ''); // $ExpectError

capitalize(); // $ExpectError
capitalize('blue man group'); // $ExpectType string
capitalize('', ''); // $ExpectError

loc(); // $ExpectError
loc("_Hello World");  // $ExpectType string
loc("_Hello %@ %@", ["John", "Smith"]);  // $ExpectType string
github hummingbird-me / hummingbird-client / app / components / stream-feed / list.js View on Github external
// posting on another user's profile
    if (get(this, 'user') !== undefined && get(this, 'user.id') !== get(this, 'session.account.id')) {
      set(data, 'targetUser', get(this, 'user'));
    }
    // posting on an interest feed
    if (get(this, 'streamInterest') !== undefined) {
      set(data, 'targetInterest', classify(get(this, 'streamInterest')));
    }
    // posting on a group
    if (get(this, 'kitsuGroup') !== undefined) {
      set(data, 'targetGroup', get(this, 'kitsuGroup'));
    }
    // spoiler + media set
    if (get(data, 'media') !== undefined && isEmpty(get(options, 'unitNumber')) === false) {
      const media = get(data, 'media');
      const mediaType = capitalize(get(media, 'modelType'));
      const unitType = mediaType === 'Anime' ? 'episode' : 'chapter';
      const number = get(options, 'unitNumber');
      let filter;
      if (mediaType === 'Anime') {
        filter = {
          mediaType,
          number,
          media_id: get(media, 'id')
        };
      } else {
        filter = { manga_id: get(media, 'id'), number };
      }
      const units = yield get(this, 'queryCache').query(unitType, { filter });
      const unit = get(units, 'firstObject');
      if (unit) {
        set(data, 'spoiledUnit', unit);
github hummingbird-me / hummingbird-client / app / routes / anime / show / characters.js View on Github external
_getFilters({ language }) {
    const controller = this.controllerFor(get(this, 'routeName'));
    const availableLanguages = get(controller, 'availableLanguages');
    // If it's empty then don't filter by language at all. Shouldn't happen tho.
    if (isEmpty(availableLanguages)) { return {}; }
    return { language: capitalize(language || get(controller, 'language')) };
  },
github cardstack / cardstack / packages / mobiledoc / addon / components / cs-mobiledoc-overview.js View on Github external
summaryForCard(cardName, payload) {
    // TODO probably we should show a thumbnail for cardstack-image cards
    if (cardName === 'cs-mobiledoc-card') {
      return { text: capitalize(payload.type.replace(/^cardstack-/, '')) };
    }
    return { text: capitalize(cardName.replace(/-card$/, '')) };
  }
github machty / ember-concurrency / tests / dummy / app / components / concurrency-graph / component.js View on Github external
state: computed('taskInstance.state', function() {
    return capitalize(this.get('taskInstance.state'));
  }),
  hasStarted: false,
github onechiporenko / ember-models-table / tests / dummy / app / routes / examples.js View on Github external
routes = routes.map(r => {
      let name = r.replace(`${thisName}.`, '');
      name = capitalize(dasherize(name).replace(/-/g, ' '));
      return {name: name, route: r};
    });
    controller.set('routes', routes);
github poteto / ember-changeset-validations / addon / utils / messages.js View on Github external
getDescriptionFor(key = '') {
    return capitalize(dasherize(key).split(/[_-]/g).join(' '));
  }
});
github ember-learn / ember-cli-addon-docs / addon / utils / computed.js View on Github external
function() {
      let klass = this.get(classKey);
      let showInternal = this.get('showInternal');
      let showInherited = this.get('showInherited');
      let showProtected = this.get('showProtected');
      let showPrivate = this.get('showPrivate');
      let showDeprecated = this.get('showDeprecated');

      let members = [];

      if (showInternal === false && memberType !== 'arguments') {
        return members;
      }

      let capitalKey = capitalize(memberType);


      let publicMembers = showInherited ? klass.get(`allPublic${capitalKey}`) : klass.get(`public${capitalKey}`);
      let privateMembers = showInherited ? klass.get(`allPrivate${capitalKey}`) : klass.get(`private${capitalKey}`);
      let protectedMembers = showInherited ? klass.get(`allProtected${capitalKey}`) : klass.get(`protected${capitalKey}`);

      members.push(...publicMembers);

      if (showPrivate) {
        members.push(...privateMembers);
      }

      if (showProtected) {
        members.push(...protectedMembers);
      }
github chrislopresto / ember-freestyle / addon / components / freestyle-usage-controls.js View on Github external
toggleUsage(usageType) {
      let usageProperty = `emberFreestyle.show${capitalize(usageType)}`;
      this.toggleProperty(usageProperty);
    },
    setFocus() {
github linkedin / WhereHows / datahub-web / packages / data-portal / app / components / search / containers / search-facets.ts View on Github external
stringToFacetOption(facetValue: string): ISearchFacetOption {
    return {
      value: facetValue,
      label: capitalize(facetValue),
      count: 0
    };
  }

@ember/string

A set of utilities to transform strings

MIT
Latest version published 5 months ago

Package Health Score

73 / 100
Full package analysis

Similar packages