read-vietnamese-number
Version:
Convert numbers to text in Vietnamese
33 lines (32 loc) • 1.13 kB
TypeScript
import { Digit, InputNumber } from './type.js';
/**
* Remove the given character from the left side of the string.
*
* @param str the string
* @param char the character to remove
* @returns the string with the given character removed from the start
*/
export declare function trimLeft(str: string, char: string): string;
/**
* Remove the given character from the right side of the string.
*
* @param str the string
* @param char the character to remove
* @returns the string with the given character removed from the end
*/
export declare function trimRight(str: string, char: string): string;
/**
* Split the given string into an array of digits.
*
* @param str the string
* @returns an array of digits, or null if the string contains invalid characters
*/
export declare function splitToDigits(str: string): Digit[] | null;
/**
* Validate the given input number and convert it to a string.
*
* @param number the input number
* @returns a string representation of the number
* @throws TypeError if the input number is not in a valid type
*/
export declare function validateNumber(number: InputNumber): string;