Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

creditable

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

creditable - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

13

creditablesecuritycode.js

@@ -19,6 +19,8 @@ // Input a credit card number string, returns a key signifying the type of credit card it is

var maxlen = self.getMaxlength();
self.$el.attr({
maxlength: maxlen,
placeholder: self.getPlaceholder( maxlen )
});
if( maxlen ) {
self.$el.attr( "maxlength", maxlen );
} else {
self.$el.removeAttr( "maxlength" );
}
self.$el.attr( "placeholder", self.getPlaceholder( maxlen || 4 ) );
});

@@ -32,3 +34,4 @@ }

CreditableSecurityCode.prototype.getPlaceholder = function( maxlen ) {
return ( new Array( maxlen || this.getMaxlength() ) ).join( "0" ) + "0";
var len = maxlen || this.getMaxlength() || 4;
return ( new Array( len ) ).join( "0" ) + "0";
};

@@ -35,0 +38,0 @@

{
"name": "creditable",
"version": "1.0.3",
"version": "1.0.4",
"description": "Utilities for working with credit card form input.",

@@ -5,0 +5,0 @@ "main": "creditablecardtype.js",

@@ -18,2 +18,19 @@ # creditable

// returns "AMEX";
```
```
## CreditableSecurityCode
Update the Security Code placeholder and maxlength based on the card type of the number entered into the Credit Card field. Full demo in `index.html`.
```
<form>
<label>
Credit Card Number
<input type="text" data-creditable-creditcard>
</label>
<label>
Security Code
<input type="text" data-creditable-securitycode>
</label>
</form>
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc