Code Monkey home page Code Monkey logo

simple-card's People

Contributors

dhershman1 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

simple-card's Issues

Make each validation method callable by itself

The plan is to allow users to bring in and call validation methods they need/want

Example:
How it currently works

import simpleCard from 'simple-card';

simpleCard('4111111111111111'); // Validate single Card Number
simpleCard('333'); // Validate single CVN
simpleCard('1/20'); // Validate single date

Instead we should allow for:
Note The import from values are concepts/placeholders that may change on release

import validNumber from 'simple-card/number';
import validCVN from 'simple-card/cvn';
import validDate from 'simple-card/expire';

validNumber('4111111111111111');
validCVN('333');
validDate('1/20');

Remove support for passing main method a single string

With the functionality of #1 we will want to remove sending a single string value to the main function to help make the code base less convoluted and easier to follow

So this example would no longer be valid:

import simpleCard from 'simple-card';

simpleCard('4111111111111111');
simpleCard('333');
simpleCard('09/10');

In favor of calling the individual methods that would be brought on by #1

Better Organization

Hopefully with the introduction of #1 and #2 we can see an improvement to code organization and a less complex code base.

However I don't want to stop there, primarily I want to finish moving internals around if they are only being used in a single spot (then whats the point in having them be in a different file?)

As well as making the code easier to sift through and understand if you want to view the source code.

Drop partial Object support

Like single string support (#2) I would probably like to remove the partial object support, because it might get in the way and create unwarrented overhead when the module is being used.

I would like to remove any overhead for finding the card type to make it as accurate as I can. As well as making the code as maintainable as I can for 2.0.0

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.