How to use the @ember/string.w 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
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 amiel / ember-data-url-templates / tests / dummy / mirage / factories / reaction.js View on Github external
verb() {
    faker.helpers.randomize(w(`
      Liked Hated Loved
    `));
  },
});
github jbandura / ember-legit-forms / addon / utils / form-validator.js View on Github external
init() {
    this._super(...arguments);
    const { rules, changeset } = getProperties(this, w('rules changeset'));

    if(!rules && !changeset) {
      return warn('[Ember Legit Forms] No rules hash provided. All fields will be valid no matter the input.');
    }

    if(rules && changeset) {
      return warn('[Ember Legit Forms] Passing in both rules and changeset is not supported.')
    }

    let strategyObj;
    if(rules) strategyObj = this._strategyObjectFactory('lfValidation', rules);
    if(changeset) strategyObj = this._strategyObjectFactory('changeset', changeset);

    set(this, 'strategy', strategyObj);
  },
github danielspaniel / ember-data-factory-guy / addon / payload / base-payload.js View on Github external
constructor(modelName, json, converter) {
    this.modelName = modelName;
    this.json = json;
    this.converter = converter;
    this.listType = converter.listType || false;
    this.proxyMethods = w("getModelPayload isProxy get add unwrap");
    this.wrap(this.proxyMethods);
  }
github jbandura / ember-legit-forms / addon / utils / form-validator.js View on Github external
_strategyObjectFactory(type, rules) {
    const strategyObj = { lfValidation: LFValidationStrategy, changeset: ChangesetStrategy }[type];
    const {
      parserService, messageProvider, lookupService, container, data
    } = getProperties(this, w('parserService messageProvider lookupService container data'));
    return new strategyObj(
      rules, parserService, messageProvider, lookupService, container, data
    );
  },
});
github sir-dunxalot / ember-tooltips / addon / components / ember-tooltip-base.js View on Github external
const innerClass = this.get('innerClass');
    const emberTooltipClass = this.get('_tooltipVariantClass');
    const emberTooltipArrowClass = `${w(emberTooltipClass).join('-arrow ')}-arrow`;
    const emberTooltipInnerClass = `${w(emberTooltipClass).join('-inner ')}-inner`;

    const targetTitle = target.title;

    target.removeAttribute('title');

    const tooltip = new Tooltip(target, {
      container: this.get('popperContainer'),
      html: true,
      placement: this.get('side'),
      title: '<span></span>',
      trigger: 'manual',
      arrowSelector: `.${w(emberTooltipArrowClass).join('.')}`,
      innerSelector: `.${w(emberTooltipInnerClass).join('.')}`,
      template: `<div style="margin:0;margin-${getOppositeSide(this.get('side'))}:${this.get('spacing')}px;" role="tooltip" class="${tooltipClass} ${emberTooltipClass} ember-tooltip-effect-${this.get('effect')}">
                   <div class="${arrowClass} ${emberTooltipArrowClass}"></div>
                   <div id="${this.get('wormholeId')}" class="${innerClass} ${emberTooltipInnerClass}"></div>
                 </div>`,

      popperOptions: {
        modifiers: mergeModifiers(
          POPPER_DEFAULT_MODIFIERS,
          this.get('popperOptions.modifiers')
        ),
github sir-dunxalot / ember-tooltips / addon / components / ember-tooltip-base.js View on Github external
createTooltip() {
    const target = this.get('target');
    const tooltipClass = this.get('tooltipClass');
    const arrowClass = this.get('arrowClass');
    const innerClass = this.get('innerClass');
    const emberTooltipClass = this.get('_tooltipVariantClass');
    const emberTooltipArrowClass = `${w(emberTooltipClass).join('-arrow ')}-arrow`;
    const emberTooltipInnerClass = `${w(emberTooltipClass).join('-inner ')}-inner`;

    const targetTitle = target.title;

    target.removeAttribute('title');

    const tooltip = new Tooltip(target, {
      container: this.get('popperContainer'),
      html: true,
      placement: this.get('side'),
      title: '<span></span>',
      trigger: 'manual',
      arrowSelector: `.${w(emberTooltipArrowClass).join('.')}`,
      innerSelector: `.${w(emberTooltipInnerClass).join('.')}`,
      template: `
github sir-dunxalot / ember-tooltips / addon / components / ember-tooltip-base.js View on Github external
const emberTooltipClass = this.get('_tooltipVariantClass');
    const emberTooltipArrowClass = `${w(emberTooltipClass).join('-arrow ')}-arrow`;
    const emberTooltipInnerClass = `${w(emberTooltipClass).join('-inner ')}-inner`;

    const targetTitle = target.title;

    target.removeAttribute('title');

    const tooltip = new Tooltip(target, {
      container: this.get('popperContainer'),
      html: true,
      placement: this.get('side'),
      title: '<span></span>',
      trigger: 'manual',
      arrowSelector: `.${w(emberTooltipArrowClass).join('.')}`,
      innerSelector: `.${w(emberTooltipInnerClass).join('.')}`,
      template: `<div style="margin:0;margin-${getOppositeSide(this.get('side'))}:${this.get('spacing')}px;" role="tooltip" class="${tooltipClass} ${emberTooltipClass} ember-tooltip-effect-${this.get('effect')}">
                   <div class="${arrowClass} ${emberTooltipArrowClass}"></div>
                   <div id="${this.get('wormholeId')}" class="${innerClass} ${emberTooltipInnerClass}"></div>
                 </div>`,

      popperOptions: {
        modifiers: mergeModifiers(
          POPPER_DEFAULT_MODIFIERS,
          this.get('popperOptions.modifiers')
        ),

        onCreate: () =&gt; {