Skip to content

Conversation

@trivikr
Copy link
Contributor

@trivikr trivikr commented May 8, 2020

Issue #, if available:
Similar to #175

Description of changes:

Before

const query: any = {
  foo: "bar"
};
if (input.baz !== undefined) {
  query["baz"] = input.baz;
}
if (input.maybeSet !== undefined) {
  query["maybeSet"] = input.maybeSet;
}

After

const query: any = {
  foo: "bar",
  ...(input.baz !== undefined && { baz: input.baz }),
  ...(input.maybeSet !== undefined && { maybeSet: input.maybeSet })
};

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@trivikr trivikr merged commit b3b5e8e into smithy-lang:master May 11, 2020
@trivikr trivikr deleted the define-query-declaration branch May 11, 2020 17:54
srchase pushed a commit to srchase/smithy-typescript that referenced this pull request Mar 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants