@types/nanp
TypeScript icon, indicating that this package has built-in type declarations

0.3.6 • Public • Published

Installation

npm install --save @types/nanp

Summary

This package contains type definitions for nanp (https://github.com/weisjohn/nanp).

Details

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

index.d.ts

interface Nanp {
    /**
     * Test if a string is a North American Number Plan (phone) number.
     *
     * @param {string} phoneNumber The phone number being tested.
     * @returns {boolean} True if the given phoneNumber is a NANP number.
     */
    (string: string): boolean;

    /**
     * Removes all parenthesis, dashes, dots, spaces.
     * Removes leading `1` or `+1` only on strings longer than 10 digits
     *
     * @param {string} phoneNumber The phone number that is being stripped.
     * @returns {string}
     */
    strip(phoneNumber: string): string;
}

declare var nanp: Nanp;

declare module "nanp" {
    export = nanp;
}

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:39 GMT
  • Dependencies: none

Credits

These definitions were written by Karn Saheb.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/nanp

Weekly Downloads

118

Version

0.3.6

License

MIT

Unpacked Size

3.77 kB

Total Files

5

Last publish

Collaborators

  • types