fix: miniKindOf returns 'object' for plain object #4160
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
name: "miniKindOf returns 'object' for plain object"
about: miniKindOf returns 'object' for plain object
PR Type
Does this PR add a new feature, or fix a bug?
Fix a bug.
Why should this PR be included?
Reference link:https://github.com/jonschlinkert/kind-of/blob/abab085d65f7ee978011da8f135291892fcd97db/index.js#L54
When I read the redux source code, its incorrect behavior confused me.
Checklist
Have you added an explanation of what your changes do and why you'd like us to include them?
Is there an existing issue for this PR?
Have the files been linted and formatted?
Have the docs been updated to match the changes in the PR?
Have the tests been updated to match the changes in the PR?
Have you run the tests locally to confirm they pass?
Bug Fixes
What is the current behavior, and the steps to reproduce the issue?
For a plain object,miniKindOf should returns ""
What is the expected behavior?
For a plain object,miniKindOf should returns "object" instead of ""
How does this PR fix the problem?
use
Object.prototype.toString.call()
to get the correct type of plain object instead oftypeof