| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Add common validators: `validateArray`, `validateBoolean`, `validateObject` and appropriate tests.
| return contextOptions; | ||
| } | ||
|
|
||
| function isContext(object) { |
There was a problem hiding this comment.
This is not changed as currently, it skips Arrays to the _isContext function which in turn rejects them. If I use validateObject it would change the error message for Arrays passed to the isContext from expected to be vm.Context to expected to be an Object and since we have explicit tests for this case I decided to not change this for now.
Sorry, something went wrong.
Sorry, something went wrong.
|
ping @nodejs/vm @BridgeAR (I guess there is no proper group for this one too). |
Sorry, something went wrong.
Sorry, something went wrong.
|
Started another CI to make sure everything is fine, the previous one is quite old. |
Sorry, something went wrong.
Add common validators: `validateArray`, `validateBoolean`, `validateObject` and appropriate tests. PR-URL: #31480 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
PR-URL: #31480 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
Sorry, something went wrong.
|
@lundibundi does this need to be backported to v13.x? it'll need manual if so. |
Sorry, something went wrong.
PR-URL: #31480 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
|
was able to get this backported... must have been some new changes that landed that made this work. removing label |
Sorry, something went wrong.
Add common validators: `validateArray`, `validateBoolean`, `validateObject` and appropriate tests. PR-URL: #31480 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Gus Caplan <me@gus.host>
| Back | FazBrowse Home | New Git URL |
The first commit adds basic validation utilities like validateArray, validateBoolean,
validateObject.
The second commit refactors vm.js with the new validators as an example. There are multiple places in the codebase where we manually validate objects and arrays which can be simplified with validators.js.
Checklist
//cc @nodejs/vm