herbsjs / gotu

Entities - Create your Entity and enjoy an elegant validation and serialization
Other
11 stars 19 forks source link

Arrays of entity type. #18

Closed endersoncosta closed 4 years ago

endersoncosta commented 4 years ago

Implementation of the entity type validation on arrays.

Issue: #17

codecov[bot] commented 4 years ago

Codecov Report

Merging #18 into master will increase coverage by 0.17%. The diff coverage is 98.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #18      +/-   ##
==========================================
+ Coverage   98.82%   99.00%   +0.17%     
==========================================
  Files           3        3              
  Lines          85      100      +15     
==========================================
+ Hits           84       99      +15     
  Misses          1        1              
Impacted Files Coverage Δ
src/field.js 96.42% <96.15%> (+0.77%) :arrow_up:
src/baseEntity.js 100.00% <100.00%> (ø)

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 6a099f8...7c40970. Read the comment docs.

dalssoft commented 4 years ago

It's has been very hard to understand this diff, although doesn't look like it changed that much. Is it because of some lint? Could you check it?

It looks like a good commit though

endersoncosta commented 4 years ago

Yes, I made this PR without lint fix and insufficient tests, I will made these changes today... Thanks!!

endersoncosta commented 4 years ago

I used the lint of the project, but the diff are still complex...

dalssoft commented 4 years ago

is this array validation also valid for Scalar types (String, Number, etc)?

endersoncosta commented 4 years ago

No, just with Entity ... But I will implement this, as soon as possible... In this moment the code is indeed incomplete...

endersoncosta commented 4 years ago

I found a problem with the metadata. When I pass several fields with typed array, the prototypes somehow are merged, then the comparison of the type aways is wrong...

endersoncosta commented 4 years ago

Now, the list accept Scalar types and Gotu Entities as well...

dalssoft commented 4 years ago

@endersoncosta could you fix the CI errors?

endersoncosta commented 4 years ago

Done!

jhomarolo commented 3 years ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: