Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unneeded complex object destruction default syntax #28

Closed
Sharaal opened this issue Jul 12, 2019 · 1 comment
Closed

Remove unneeded complex object destruction default syntax #28

Sharaal opened this issue Jul 12, 2019 · 1 comment
Assignees

Comments

@Sharaal
Copy link
Owner

Sharaal commented Jul 12, 2019

Currently I always use a complex structure to define defaults in object destructions, e.g.:


module.exports = ({
  client,
  defaultSerialColumn: defaultSerialColumn = 'id',
  defaultSerialColumn = 'id',
  defaultSchema,
  defaultFallbackLimit: defaultFallbackLimit = 10,
  defaultMaxLimit: defaultMaxLimit = 100,
  defaultPageSize: defaultPageSize = 10
  defaultFallbackLimit = 10,
  defaultMaxLimit = 100,
  defaultPageSize = 10
} = {}) => {
...
}

But I don't know why I always these complex structure and it can be reduced to the simpler one, e.g.:

module.exports = ({
  client,
  defaultSerialColumn = 'id',
  defaultSerialColumn = 'id',
  defaultSchema,
  defaultFallbackLimit = 10,
  defaultMaxLimit = 100,
  defaultPageSize = 10
  defaultFallbackLimit = 10,
  defaultMaxLimit = 100,
  defaultPageSize = 10
} = {}) => {
...
}
@Sharaal Sharaal self-assigned this Jul 12, 2019
Sharaal added a commit that referenced this issue Jul 12, 2019
…struction-default-syntax-#28

Remove unneeded complex object destruction default syntax #28
@Sharaal
Copy link
Owner Author

Sharaal commented Jul 12, 2019

Changed with v6.1.1.

@Sharaal Sharaal closed this as completed Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant