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

fix(types): correct type of Datastore.KEY #459

Merged
merged 2 commits into from
Jul 30, 2019

Conversation

ckknight
Copy link
Contributor

@ckknight ckknight commented Jul 25, 2019

entity.KEY_SYMBOL is defined as a unique symbol and without explicit reference back to the original type, the unique symbol flows into a regular symbol, which loses some of its semantic meaning.

This guarantees that Datastore.KEY and entity.KEY_SYMBOL (and new Datastore().KEY) are truly equivalent within the type system.

  • Tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

`entity.KEY_SYMBOL` is defined as a `unique symbol` and without explicit reference back to the original type, the `unique symbol` flows into a regular `symbol`, which loses some of its semantic meaning.

This guarantees that `Datastore.KEY` and `entity.KEY_SYMBOL` (and `new Datastore().KEY`) are truly equivalent within the type system.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 25, 2019
Copy link
Contributor

@bcoe bcoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks reasonable to me 👍

@bcoe bcoe requested a review from jkwlui July 29, 2019 20:53
@JustinBeckwith JustinBeckwith added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 30, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Jul 30, 2019
@JustinBeckwith JustinBeckwith changed the title Fix type of Datastore.KEY fix(types): correct type of Datastore.KEY Jul 30, 2019
@codecov
Copy link

codecov bot commented Jul 30, 2019

Codecov Report

Merging #459 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #459   +/-   ##
=======================================
  Coverage   98.12%   98.12%           
=======================================
  Files           5        5           
  Lines         639      639           
  Branches      153      153           
=======================================
  Hits          627      627           
  Partials       12       12
Impacted Files Coverage Δ
src/index.ts 98.66% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 215cbee...e6e0f19. Read the comment docs.

@JustinBeckwith JustinBeckwith merged commit 09def6d into googleapis:master Jul 30, 2019
@ckknight ckknight deleted the patch-1 branch August 5, 2019 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants