npm.io
0.3.6 • Published 2 years ago

@types/nanp

Licence
MIT
Version
0.3.6
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
51.4K

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 0939 GMT
  • Dependencies: none

Credits

These definitions were written by Karn Saheb.