mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
Fix Travis errors
This commit is contained in:
@@ -1,31 +1,27 @@
|
||||
import valid = require('card-validator');
|
||||
|
||||
var numberValidation = valid.number('4111');
|
||||
const numberValidation = valid.number('4111');
|
||||
|
||||
if (!numberValidation.isPotentiallyValid) {
|
||||
|
||||
}
|
||||
if (numberValidation.card) {
|
||||
if (!numberValidation.isPotentiallyValid && numberValidation.card) {
|
||||
numberValidation.card.type;
|
||||
}
|
||||
|
||||
valid.expirationDate('10/19');
|
||||
let dateTest2 = valid.expirationDate({month: '1', year: '2019'})
|
||||
const dateTest2 = valid.expirationDate({month: '1', year: '2019'});
|
||||
if (dateTest2.isPotentiallyValid) {
|
||||
dateTest2.month;
|
||||
}
|
||||
|
||||
let expirationMonthCheck = valid.expirationMonth('10');
|
||||
const expirationMonthCheck = valid.expirationMonth('10');
|
||||
if (expirationMonthCheck.isPotentiallyValid) {
|
||||
expirationMonthCheck.isValidForThisYear
|
||||
expirationMonthCheck.isValidForThisYear;
|
||||
}
|
||||
|
||||
let expirationYearCheck = valid.expirationYear('10');
|
||||
const expirationYearCheck = valid.expirationYear('10');
|
||||
if (expirationYearCheck.isPotentiallyValid) {
|
||||
expirationYearCheck.isCurrentYear;
|
||||
}
|
||||
|
||||
|
||||
let postalCodeCheck = valid.postalCode('123');
|
||||
|
||||
if (postalCodeCheck.isValid) {
|
||||
@@ -33,7 +29,7 @@ if (postalCodeCheck.isValid) {
|
||||
postalCodeCheck = valid.postalCode('123', {minLength: 5});
|
||||
}
|
||||
|
||||
let cvvCeck = valid.cvv('1234');
|
||||
const cvvCeck = valid.cvv('1234');
|
||||
if (cvvCeck.isValid) {
|
||||
valid.cvv('12345', 4)
|
||||
valid.cvv('12345', 4);
|
||||
}
|
||||
|
||||
17
types/card-validator/index.d.ts
vendored
17
types/card-validator/index.d.ts
vendored
@@ -1,4 +1,4 @@
|
||||
// Type definitions for card-validator
|
||||
// Type definitions for card-validator 4.1.0
|
||||
// Project: https://github.com/braintree/card-validator
|
||||
// Definitions by: Gregory Moore <https://github.com/ChanceM>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -10,7 +10,7 @@ interface Card {
|
||||
isAmex: boolean;
|
||||
gaps: number[];
|
||||
lengths: number[];
|
||||
code: {name: string, size: number}
|
||||
code: {name: string, size: number};
|
||||
}
|
||||
|
||||
interface valid {
|
||||
@@ -35,10 +35,9 @@ interface validExpirationYear extends valid {
|
||||
isCurrentYear: boolean;
|
||||
}
|
||||
|
||||
|
||||
export declare function number(value: string): validNumber;
|
||||
export declare function expirationDate(value: string | {month: string, year: string}): validExpirationDate;
|
||||
export declare function expirationMonth(value: string): validExpirationMonth;
|
||||
export declare function expirationYear(value: string): validExpirationYear;
|
||||
export declare function cvv(value: string, maxLength?: number): valid;
|
||||
export declare function postalCode(value: string, options?: {minLength?: number}): valid;
|
||||
export function number(value: string): validNumber;
|
||||
export function expirationDate(value: string | {month: string, year: string}): validExpirationDate;
|
||||
export function expirationMonth(value: string): validExpirationMonth;
|
||||
export function expirationYear(value: string): validExpirationYear;
|
||||
export function cvv(value: string, maxLength?: number): valid;
|
||||
export function postalCode(value: string, options?: {minLength?: number}): valid;
|
||||
|
||||
Reference in New Issue
Block a user