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

code-gen: add file validator support #649

Merged
merged 1 commit into from
Feb 2, 2021
Merged

Conversation

dirkdev98
Copy link
Member

We can now validate files in a few places where we previously we could only check if it was available:

  • isBrowser api input
  • isBrowser api output
  • !isBrowser api client input
  • !isBrowser api response
  • !isBrowser route validators via router

Closes #645

We can now validate files in a few places where we previously we could only check if it was available:
- `isBrowser` api input
- `isBrowser` api output
- `!isBrowser` api client input
- `!isBrowser` api response
- `!isBrowser` route validators via router

Closes #645
@dirkdev98 dirkdev98 enabled auto-merge (squash) February 2, 2021 20:55
@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2021

==== Benchmark result ====

Node.js version: 14
Total benchmarks: 15
          Passed: 15
          Failed: 0
-----------
router - github static path              200000  iterations    6490  ns/op
router - github path params              200000  iterations    8641  ns/op
compas validator simple                 5000000  iterations     217  ns/op
yup validator simple                     100000  iterations   10299  ns/op
fastest-validator validator simple     20000000  iterations      95  ns/op
compas validator nested                 1000000  iterations    1115  ns/op
yup validator nested                      50000  iterations   31761  ns/op
fastest-validator validator nested      5000000  iterations     460  ns/op
logger - strings                         500000  iterations    2432  ns/op
logger - objects                         500000  iterations    2910  ns/op
logger - deep objects                    500000  iterations    4177  ns/op
uuid                                    5000000  iterations     423  ns/op
uuid.isValid                           10000000  iterations     140  ns/op
isNil                                 500000000  iterations       0  ns/op
isPlainObject                         100000000  iterations      17  ns/op

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2021

==== Benchmark result ====

Node.js version: 15
Total benchmarks: 15
          Passed: 15
          Failed: 0
-----------
router - github static path              200000  iterations    6767  ns/op
router - github path params              200000  iterations    8145  ns/op
compas validator simple                 5000000  iterations     207  ns/op
yup validator simple                     100000  iterations   10155  ns/op
fastest-validator validator simple     20000000  iterations      98  ns/op
compas validator nested                 1000000  iterations    1195  ns/op
yup validator nested                      50000  iterations   32200  ns/op
fastest-validator validator nested      5000000  iterations     459  ns/op
logger - strings                         500000  iterations    2336  ns/op
logger - objects                         500000  iterations    2856  ns/op
logger - deep objects                    500000  iterations    4101  ns/op
uuid                                    5000000  iterations     329  ns/op
uuid.isValid                           10000000  iterations     134  ns/op
isNil                                 500000000  iterations       0  ns/op
isPlainObject                         100000000  iterations      17  ns/op

@github-actions
Copy link
Contributor

github-actions bot commented Feb 2, 2021

==== C8 test coverage ====
Statements: 66.41% ( 24588/37024 )
Branches : 65.26% ( 2714 /4159 )
Functions : 66.86% ( 825 /1234 )
Lines : 66.41% ( 24588 /37024 )

@dirkdev98 dirkdev98 merged commit 754484c into main Feb 2, 2021
@dirkdev98 dirkdev98 deleted the feat/code-gen-file-validator branch February 2, 2021 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

code-gen: add validator and better type for files
1 participant