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: use isArray util function to check the type of the array #596

Merged
merged 1 commit into from
Mar 11, 2020

Conversation

kiaking
Copy link
Member

@kiaking kiaking commented Mar 11, 2020

When checking a value is a type of array, using foo instanceof Array was causing false negative in Nuxt server side env. It's fixed by using Array.isArray() instead.

This PR adds isArray utility function, and replaces all Array.isArray() and foo instanceof Array condition checks.

Type of PR:

  • Bugfix
  • Feature
  • Enhancement
  • Documentation
  • Other

Breaking changes:

  • No
  • Yes

`instanceof` check was causing false negative in Nuxt server side env. It's fixed
by using `Array.isArray()` instead.
@kiaking kiaking added the bug Something isn't working label Mar 11, 2020
@kiaking kiaking self-assigned this Mar 11, 2020
@kiaking kiaking added this to the v1.0.0 milestone Mar 11, 2020
@codecov
Copy link

codecov bot commented Mar 11, 2020

Codecov Report

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

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #596   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          47     47           
  Lines        1904   1910    +6     
  Branches      270    270           
=====================================
+ Hits         1904   1910    +6
Impacted Files Coverage Δ
src/attributes/relations/Relation.ts 100% <100%> (ø) ⬆️
src/attributes/relations/MorphedByMany.ts 100% <100%> (ø) ⬆️
src/modules/Actions.ts 100% <100%> (ø) ⬆️
src/schema/IdAttribute.ts 100% <100%> (ø) ⬆️
src/attributes/relations/BelongsToMany.ts 100% <100%> (ø) ⬆️
src/query/loaders/Loader.ts 100% <100%> (ø) ⬆️
src/attributes/relations/MorphToMany.ts 100% <100%> (ø) ⬆️
src/query/processors/Normalizer.ts 100% <100%> (ø) ⬆️
src/query/rollcallers/Rollcaller.ts 100% <100%> (ø) ⬆️
src/query/filters/WhereFilter.ts 100% <100%> (ø) ⬆️
... and 3 more

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 04909f9...d8b57a8. Read the comment docs.

@kiaking kiaking merged commit 900c9af into master Mar 11, 2020
@kiaking kiaking deleted the fix-array-type-check branch March 11, 2020 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant