dhershman1 / simple-card Goto Github PK
View Code? Open in Web Editor NEWSimple Card Validation, also provides feedback with information on card type, and other useful pieces.
Home Page: http://www.dusty.codes/simple-card
License: MIT License
Simple Card Validation, also provides feedback with information on card type, and other useful pieces.
Home Page: http://www.dusty.codes/simple-card
License: MIT License
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');
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
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.
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.