Comments (4)
Closing this issue as the Constraints type has been exposed.
from checkpass.
Hello @tleperou
Firstly, thanks for taking the time to try out the library!
As to your question, I believe you're saying we need to export the Constraints type as well.
On those lines, I've made the updates so you could do something like this
This should make it easier to consume the library code. You will find these updates in version 2.0.1 or version 1.0.6 (they're both actually the same and don't have any breaking changes.)
There is also version 3.0.0 which has a major API update. The code now checks against all the constraints simultaneously and returns an object with details about all the constraints. Something like this
So as you can see above, the constraints minCapitalLetters and minSpecialCharacters are failing and so they have value set to true and a corresponding generic failure message.
This is done to make the usage of the library more flexible as the user can decide what to do with the returned constrained checks as opposed to just getting a string based on one of the failed checks.
Please use versions 1.0.6 or 2.0.1 to use the code as you have been. Version 3 has an API update which would work differently as above.
from checkpass.
Awesome! Well, thanks for taking time to explain all of that.
Is the version 3 stable and ready to used?
🖖
from checkpass.
Yes, it should be. Let me know if anything does not work right or if you face any issues.
from checkpass.
Related Issues (1)
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 checkpass.