UNPKG

polish-validators

Version:

A set of validator functions that check common polish numbers.

26 lines (25 loc) 1.15 kB
/** * Validates an ISBN (International Standard Book Number), supporting both ISBN-10 and * ISBN-13 formats. Ensures that the ISBN has the correct format and checksum. Any dashes * or whitespace are ignored. * * @param {string} isbn - The ISBN as a string. * @returns {boolean} `true` if the ISBN is valid; `false` otherwise. */ export declare function isIsbnValid(isbn: string): boolean; /** * Validates an ISBN (International Standard Book Number), supporting both ISBN-10 and * ISBN-13 formats. Ensures that the ISBN has the correct format and checksum. Any dashes * or whitespace are ignored. * * @param {string} isbn - The ISBN as a string. * @returns {boolean} `true` if the ISBN is invalid; `false` otherwise. */ export declare const isIsbnInvalid: (isbn: string) => boolean; /** * Determines the region name associated with an ISBN based on its prefix. Region names are all in Polish. * * @param {string} isbn - The ISBN as a string. * @returns {string | null} The region name as a string, or `null` if not recognized. */ export declare function getRegionNameFromIsbn(isbn: string): string | null;