Skip to content

Invalid shifting with JavaScript objects #48

@patric-eberle

Description

@patric-eberle

Shifter: 1.9.6

When sorting a JavaScript object, the code gets messed up, unless only ES2015 shorthand definition or primitive key/value pairs are used.

Case 1:

const foo = {
  userRights,
  cWishLists: cWishLists.getAllWishLists,
  cVariantSelector,
};

This one works, as long as I only select the inner rows of the object.

Case 2:

const foo = {
  baa: {
    foo: 'baa',
  },
  userRights,
  cWishLists: cWishLists.getAllWishLists,
  cVariantSelector,
};

This one fails and produces the following result:

const foo = {
  foo: 'baa',
  baa: {
    cVariantSelector,
    cWishLists: cWishLists.getAllWishLists,
    userRights,
  },
};

Selecting the whole variable fails entirely (which I think may be OK...)

cVariantSelector,
  cWishLists;
:
cWishLists.getAllWishLists,
  userRights,
const foo = {};

Grüäss us Sanggallä 😃

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions