Skip to content

Brace expansion should allow whitespace #16585

@ahopkins

Description

@ahopkins

Consider this example:

someWeatherComputedProperty: computed(
    'someObj.{ \
      day1.currentforecast, \
      day2.currentforecast, \
      day3.currentforecast, \
      day4.currentforecast, \
      day5.currentforecast, \
      day6.currentforecast, \
      day7.currentforecast}',
    'otherStuff',
    'moreOtherStuff', function() {

versus

someWeatherComputedProperty: computed('someObj{day1.currentforecast,day2.currentforecast,day3.currentforecast,day4.currentforecast,day5.currentforecast,day6.currentforecast,day7.currentforecast}', 'otherStuff', 'moreOtherStuff', function() {

Which one is easier to read?

Even the Error message itself makes the case:

Assertion Failed: Brace expanded properties cannot contain spaces, e.g. "user.{firstName, lastName}" should be "user.{firstName,lastName}"

I would suggest that user.{firstName, lastName} is simpler and more readable than user.{firstName,lastName}.

Am I missing something? Is there a legitimate reason that whitespace cannot be stripped out?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions