Skip to content
This repository was archived by the owner on Jun 11, 2024. It is now read-only.

validator.validate has type void #8526

Closed
Tracked by #7226
endro42 opened this issue Jun 2, 2023 · 1 comment
Closed
Tracked by #7226

validator.validate has type void #8526

endro42 opened this issue Jun 2, 2023 · 1 comment
Assignees
Milestone

Comments

@endro42
Copy link

endro42 commented Jun 2, 2023

Expected behavior

In the docs under section creating transactions transactionErrors should be typed so that length and the spread operation is available with Typescript

Actual behavior

image

Steps to reproduce

Create a local project with Typescript and import the code given in the Lisk docs

Which version(s) does this affect? (Environment, OS, etc...)

@shuse2
Copy link
Collaborator

shuse2 commented Jun 5, 2023

This is problem in the documentation than Lisk SDK.
the new usage should be

validator.validate<SomeExpectedType>(schema, object)

and if it does not match the schema, it will throw. and the object will be typed as SomeExpectedType after this call

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants