vapor / async-kit

Sugary extensions for the SwiftNIO library
MIT License
71 stars 25 forks source link

Add EventLoopFuture utility methods for handling empty collection values #83

Closed gwynne closed 3 years ago

gwynne commented 3 years ago

Provides:

Example usage:

return MyModel.query(on: request.db)
    .filter(\.foo == bar)
    .all()
    .nonempty(orError: Abort(.notFound))
    .map { ...
return MyModel.query(on: request.db)
    .filter(\.foo == bar)
    .all()
    .nonemptyMap { models -> [Something] in
        ...
codecov-commenter commented 3 years ago

Codecov Report

:exclamation: No coverage uploaded for pull request base (main@535bb30). Click here to learn what that means. The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #83   +/-   ##
=======================================
  Coverage        ?   76.95%           
=======================================
  Files           ?       26           
  Lines           ?     1766           
  Branches        ?        0           
=======================================
  Hits            ?     1359           
  Misses          ?      407           
  Partials        ?        0           
Flag Coverage Δ
unittests 76.95% <0.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out 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 535bb30...f342808. Read the comment docs.

gwynne commented 3 years ago

Huh, I'd swear I put the semver label on it... oh well, doing it manually.