How to use @ember/string - 10 common examples

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 DefinitelyTyped / DefinitelyTyped / types / ember__string / ember__string-tests.ts View on Github external
import { dasherize, camelize, capitalize, classify, decamelize, loc, underscore, w } from '@ember/string';

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

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

decamelize(); // $ExpectError
decamelize('blue man group'); // $ExpectType string
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
github DefinitelyTyped / DefinitelyTyped / types / ember__string / ember__string-tests.ts View on Github external
dasherize('', ''); // $ExpectError

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

decamelize(); // $ExpectError
decamelize('blue man group'); // $ExpectType string
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 DefinitelyTyped / DefinitelyTyped / types / ember__string / ember__string-tests.ts View on Github external
camelize(); // $ExpectError
camelize('blue man group'); // $ExpectType string
camelize('', ''); // $ExpectError

decamelize(); // $ExpectError
decamelize('blue man group'); // $ExpectType string
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 DefinitelyTyped / DefinitelyTyped / types / ember__string / ember__string-tests.ts View on Github external
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 DefinitelyTyped / DefinitelyTyped / types / ember__string / ember__string-tests.ts View on Github external
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 GeenPeil / teken / frontend / geenpeil-ember / app / components / string-display.js View on Github external
if(display) {
      var valueParts = [];
      var parts = display.split(' ');
      var endIndex = 0;
      var startIndex = 0;
      for(var i=0;i
github lstrrs / ember-line-clamp / addon / components / line-clamp.js View on Github external
_getLines() {
    const lines = [];
    const numLines = this.get('lines');
    const text = this.get('text') || '';
    const textToTruncate = isHTMLSafe(text) ? this._unescapeText(text) : text;
    const formattedText = this.stripText ? this._stripBrTags(textToTruncate) : this._convertBrTags(textToTruncate);
    const textLines = formattedText.split('\n').map(line => line.trim().split(' '));
    let didTruncate = true;

    const ellipsisWidth = this._getEllipsisWidth();

    for (let line = 1; line <= numLines; line += 1) {
      const textWords = textLines[0];

      // handle new line -- ???
      if (textWords.length === 0) {
        lines.push({
          newLine: true,
        });
        textLines.shift();
        line -= 1;
github Deveo / ember-emojione / addon / services / emoji.js View on Github external
return !emojiDefs[`${id}_tone${anotherTone}`];
        });

    return A(emoji);
  });
}

export default Service.extend({
  emojiDefs,

  categories: A([
    O({id: "people",   name: "Smileys & People", icon: htmlSafe(":grinning:")}),
    O({id: "nature",   name: "Animals & Nature", icon: htmlSafe(":deciduous_tree:")}),
    O({id: "food",     name: "Food & Drink",     icon: htmlSafe(":pizza:")}),
    O({id: "activity", name: "Activity",         icon: htmlSafe(":cartwheel:")}),
    O({id: "travel",   name: "Travel & Places",  icon: htmlSafe(":ship:")}),
    O({id: "objects",  name: "Objects",          icon: htmlSafe(":hammer:")}),
    O({id: "symbols",  name: "Symbols",          icon: htmlSafe(":heart:")}),
    O({id: "flags",    name: "Flags",            icon: htmlSafe(":flag_aq:")}),
    // "regional",
    // "modifier",
  ]),

  emojiCategoryIds: EMOJI_CATEGORIES_ARRAY,
  emojiToneIds: EMOJI_TONES_ARRAY,

  _currentSkinTone: 'default',

  currentSkinTone: computed('_currentSkinTone', {
    get() {
      return this.get('_currentSkinTone');
    },
github discourse / discourse / app / assets / javascripts / discourse / lib / show-modal.js.es6 View on Github external
export default function(name, opts) {
  opts = opts || {};
  const container = Discourse.__container__;

  // We use the container here because modals are like singletons
  // in Discourse. Only one can be shown with a particular state.
  const route = container.lookup("route:application");
  const modalController = route.controllerFor("modal");

  modalController.set("modalClass", opts.modalClass);

  const controllerName = opts.admin ? `modals/${name}` : name;
  modalController.set("name", controllerName);

  let controller = container.lookup("controller:" + controllerName);
  const templateName = opts.templateName || dasherize(name);

  const renderArgs = { into: "modal", outlet: "modalBody" };
  if (controller) {
    renderArgs.controller = controllerName;
  } else {
    // use a basic controller
    renderArgs.controller = "basic-modal-body";
    controller = container.lookup(`controller:${renderArgs.controller}`);
  }

  if (opts.addModalBodyView) {
    renderArgs.view = "modal-body";
  }

  const modalName = `modal/${templateName}`;
  const fullName = opts.admin ? `admin/templates/${modalName}` : modalName;

@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