Skip to content

Conversation

@CraftingGamerTom
Copy link
Contributor

Added a check for both ways a string can be defined. This fixes an exception when the server returns a string instead of an object. See #699 for more information.

Added a check for both ways a string can be defined. This fixes an exception when the server returns a string instead of an object. See #699 for more information.
Copy link
Collaborator

@JoaoPedroAS51 JoaoPedroAS51 left a comment

Choose a reason for hiding this comment

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

Hi @CraftingGamerTom! Thank you for the PR! Nice work 😄

My PR #941 was for dev branch, yours is for master :)

What do you think about using typeof holder !== 'object'?

@JoaoPedroAS51 JoaoPedroAS51 changed the title Add check for String type instead of an object in getProp() #699 fix(utils): check if holder is object in getProp util Dec 18, 2020
@CraftingGamerTom
Copy link
Contributor Author

It won't work / fix the problem I solved in #699 .

But I'm sure that you guys will sort that out cause confused how I can have a PR for 5 months ago and no responses from anyone and then out of nowhere that contribution gets scooped up into a different PR for the exact same issue and it gets approved and I get asked if it is okay 😂

@JoaoPedroAS51
Copy link
Collaborator

We were busy on other things in the last few months, but we're here now. I'm so sorry for the delay.

Why it won't work / fix the problem you solved?

@CraftingGamerTom CraftingGamerTom changed the base branch from master to dev December 18, 2020 15:50
@JoaoPedroAS51
Copy link
Collaborator

JoaoPedroAS51 commented Dec 18, 2020

@CraftingGamerTom Sorry, I think we had a misunderstanding. What I was trying to say is that my PR #941 was merged into v5 (dev branch). Then, I would like to merge your PR into v4 (master branch). And, I would like to know if you agree about changing here to typeof holder !== 'object' as well, so we keep same code on both.

@CraftingGamerTom
Copy link
Contributor Author

CraftingGamerTom commented Dec 18, 2020

I owe you an apology. I'm sorry. Not only did I misunderstand the plan, I also jumped the gun and misunderstood your (much more elegant) solution. I was admittedly butt-hurt because it was not apparent that you created a PR for any other reason other than to solve the same problem but not consider my PR. Then yours was approved quickly. I didn't see any other issues your PR was related to and assumed you came out of nowhere on #699 and just remade my PR pointed at the correct branch. I'm not very familiar with the contribution process to the nuxt-community but I think I've learned a lot today.


Okay, I will put this back to pointing at master. I believe I did intend this for dev? It was so long ago. I don't remember.
I also had a hard time reproducing my original error as I thought I used your proposed solution and still had errors but after much more testing than I am willing to admit to I still cannot reproduce any errors. I'll make a commit to match your solution.

Also, I originally did not think your solution would work because I had a false understanding that a String object (created with a constructor) would not work with your solution - my testing showed it would work. Nice work on this.

Some more info on this:
https://stackoverflow.com/questions/17256182/what-is-the-difference-between-string-primitives-and-string-objects-in-javascrip

I also updated the codepen with some better examples
https://codepen.io/craftinggamertom/pen/zYrZLvN

@CraftingGamerTom CraftingGamerTom changed the base branch from dev to master December 18, 2020 22:11
@JoaoPedroAS51
Copy link
Collaborator

@CraftingGamerTom No problem! And thank you for having time to find and fix this issue :)

@JoaoPedroAS51 JoaoPedroAS51 merged commit c3aefd0 into nuxt-community:master Dec 18, 2020
@JoaoPedroAS51
Copy link
Collaborator

@CraftingGamerTom Sorry again for the confusion. Just fixed the other PR/commit 23ecb31, marking you as author :)

@CraftingGamerTom CraftingGamerTom deleted the bug-fix/Cannot-use-in-operator-to-seach-for-token branch December 19, 2020 00:14
harish2704 added a commit to harish2704/auth-module that referenced this pull request May 14, 2022
…erbase

* upstream/master: (44 commits)
  chore(docs): Add note about gotcha when extending (nuxt-community#710)
  fix(utils): check if `holder` is `object` in `getProp` util (nuxt-community#738)
  chore(deps): update `@nuxtjs/axios` to v5.12.4
  Update facebook.md (nuxt-community#564)
  fix(module): build core files to `core` dir (nuxt-community#909)
  chore: update all dependencies, lock axios to 5.12.1 (nuxt-community#911)
  chore(demo): add express-jwt algorithms (nuxt-community#912)
  fix(oauth): nanoid import (nuxt-community#906)
  fix: path to utilities folder
  docs: fix typo in options (nuxt-community#799)
  docs: fix broken link in strategy section (nuxt-community#754)
  docs: update readme.md (nuxt-community#704)
  docs(scheme): add custom scheme creation docs (nuxt-community#692)
  docs(local scheme): clearer understanding of `autoFetchUser` option (nuxt-community#677)
  docs(local scheme): add `globalToken` (nuxt-community#667)
  chore(release): 4.9.1
  chore: update lockfile
  demo: fix `data` object property (nuxt-community#580)
  docs(options): fix typo in callback paragraph (nuxt-community#582)
  docs(oauth2): fix broken link (nuxt-community#609)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants