1.0.6 • Published 6 months ago
piri-reis v1.0.6
Piri Reis
A collection of JavaScript/TypeScript functions tailored for Turkish web projects.
Installation
Using npm:
npm install piri-reis
Functions
formatDate.ts
Formats a given date to Turkish locale.
formatDate(date: Date): string
formatTurkishLira.ts
Formats a given number into Turkish Lira representation.
formatTurkishLira(amount: number): string
hasTurkishVowels.ts
Checks if a string contains Turkish vowels.
hasTurkishVowels(str: string): boolean
replaceTurkishChars.ts
Replaces Turkish characters in a string with their English counterparts.
replaceTurkishChars(input: string): string
toUrlSlug.ts
Converts a given string into a URL-friendly slug, considering Turkish characters.
toUrlSlug(sentence: string): string
isTRNationalIDValid.ts
Validates a given Turkish National ID.
isTRNationalIDValid(nationalID: string): boolean
getCityFromPlate.ts
Retrieves the city name based on the provided Turkish plate code.
getCityFromPlate(plateNumber: string): string | null
calculateTurkishVAT.ts
Calculates the Value Added Tax (VAT) amount for a given amount based on the Turkish VAT rate.
calculateTurkishVAT(amount: number, vatRate: number): number
Contributing
- Fork the project.
- Create your feature branch:
git checkout -b feature/YourFeatureName
. - Commit your changes:
git commit -m 'Add some feature'
. - Push to the branch:
git push origin feature/YourFeatureName
. - Open a pull request.