Giter Site home page Giter Site logo

Input validation about dialoguer HOT 5 CLOSED

batisteo avatar batisteo commented on June 29, 2024
Input validation

from dialoguer.

Comments (5)

pksunkara avatar pksunkara commented on June 29, 2024 1

No, that needs changes in the interaction logic for prompts. You can either write one yourself or if it's something common like a number, then contribute it to the library.

from dialoguer.

nicohman avatar nicohman commented on June 29, 2024

I added some basic input validation functionality, including prebuilt phone number and email address validators. Are there any other validators that you think should be in by default?

from dialoguer.

jamesmcm avatar jamesmcm commented on June 29, 2024

Would it be possible to disallow the user to even enter characters for example?

So like we could set an Input to be numeric only, and pressing non-digits has no effect?

I haven't checked the source code to see if you handle it as a line of input or character by character, so this might not be possible.

from dialoguer.

RobWalt avatar RobWalt commented on June 29, 2024

@batisteo I don't know when it was added, but there exists an input validation feature now. If you have some spare time, can you check if this is what you originally envisioned when you opened the issue?

from dialoguer.

batisteo avatar batisteo commented on June 29, 2024

I guess it would do it. I was thinking about including some common ones (int, str, email…) but I far as I can see it seems very flexible solution.

from dialoguer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.