You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@types/creditcardutils

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/creditcardutils

TypeScript definitions for creditcardutils

1.0.2
ts4.5
ts4.6
ts4.7
ts4.8
ts4.9
ts5.0
ts5.1
ts5.2
ts5.3
ts5.4
ts5.5
ts5.6
ts5.7
ts5.8
ts5.9
latest
Source
npmnpm
Version published
Maintainers
1
Created
Source

Installation

npm install --save @types/creditcardutils

Summary

This package contains type definitions for creditcardutils (https://github.com/faaez/creditcardutils#readme).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/creditcardutils.

index.d.ts

/**
 * Validates a credit card number. Returns a boolean.
 */
export function validateCardNumber(cardNumber: string): boolean;

/**
 * Takes an unformatted credit card number and returns a formatted string.
 */
export function formatCardNumber(unformatted: string): string;

/**
 * Gets credit card type from its number. Returns a string.
 */
export function parseCardType(cardNumber: string): string;

/**
 * Validates a credit card expiry. Returns a boolean.
 */
export function validateCardExpiry(month: string, year: string): boolean;

/**
 * Gets credit card expiration from its date. Returns a formatted string of the shape MM / YY.
 */
export function formatCardExpiry(expiration: string): string;

/**
 * Parses credit card expiration from the date. Returns an object of the shape { month: 4, year: 2021 }.
 */
export function parseCardExpiry(expiration: string): object;

/**
 * Validates a credit card CVC. Returns a boolean.
 */
export function validateCardCVC(cvc: string, type?: string): boolean;

// /**
//  * Validates a credit card CVC. Returns a boolean.
//  */
// export function validateCardCVC(cvc: string, type: string): boolean;

export as namespace creditcardutils;

Additional Details

  • Last updated: Mon, 06 Nov 2023 22:41:05 GMT
  • Dependencies: none

Credits

These definitions were written by Steven Conaway.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts