Comments (6)
import * as Validator from "fastest-validator";
from fastest-validator.
This doesnt work for me. Does this work for anyone?
from fastest-validator.
This expression is not constructable.
Type 'typeof import("fastest-validator")' has no construct signatures.
16 const validator = new Validator({
~~~~~~~~~
at createTSError (/home/wiski/projects/namedomain/node_modules/ts-node/src/index.ts:421:12)
at reportTSError (/home/wiski/projects/namedomain/node_modules/ts-node/src/index.ts:425:19)
from fastest-validator.
@akazakou do you have any clue?
from fastest-validator.
@wi-ski @icebob Looks like a bug in ts-node. If we are not using tslib to handle require functionality, I've also had the same issue. But based on my gist it works fine https://gist.github.com/akazakou/20d4368d087a9d874eecd65f9e8f70d8
from fastest-validator.
After a deep investigation, I found that it not working without enabled esModuleInterop
option for ts-node
TS_NODE_COMPILER_OPTIONS='{"esModuleInterop": true}' ts-node index.ts
from fastest-validator.
Related Issues (20)
- Pass in objects as an error message HOT 1
- Record + custom validation behaviour
- How to validate fields with name like name="field[name]" in browser? HOT 1
- Error: Cannot find module 'prettier' HOT 6
- Risk of remote code execution for untrusted schemas HOT 4
- Make a field Optional based on the presence of another field HOT 1
- Feature Request: Support for Array of Functions in Custom Property HOT 2
- Alias for a nested object schema HOT 1
- How to make such a type that the field is either absent at all or is a number HOT 2
- Nullable not working inside Array items HOT 2
- Not able to get the custom validator work HOT 2
- Wrong typescript definition for ValidationSchema
- Conversion of optional numbers results in 0, and ignores default, when given blank string HOT 3
- Content Security Policy (CSP) conflict HOT 1
- Support for date-time, time string format. HOT 6
- allow to add metas in the schema HOT 5
- min and max doesnt give desired result for type number HOT 1
- shorthand define can't custom label?
- Auto Schema Generation from TypeScript Interface or Type ?
- TypeError: str.replace is not a function. HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastest-validator.