1.0.6 • Published 2 years 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-reisFunctions
formatDate.ts
Formats a given date to Turkish locale.
formatDate(date: Date): stringformatTurkishLira.ts
Formats a given number into Turkish Lira representation.
formatTurkishLira(amount: number): stringhasTurkishVowels.ts
Checks if a string contains Turkish vowels.
hasTurkishVowels(str: string): booleanreplaceTurkishChars.ts
Replaces Turkish characters in a string with their English counterparts.
replaceTurkishChars(input: string): stringtoUrlSlug.ts
Converts a given string into a URL-friendly slug, considering Turkish characters.
toUrlSlug(sentence: string): stringisTRNationalIDValid.ts
Validates a given Turkish National ID.
isTRNationalIDValid(nationalID: string): booleangetCityFromPlate.ts
Retrieves the city name based on the provided Turkish plate code.
getCityFromPlate(plateNumber: string): string | nullcalculateTurkishVAT.ts
Calculates the Value Added Tax (VAT) amount for a given amount based on the Turkish VAT rate.
calculateTurkishVAT(amount: number, vatRate: number): numberContributing
- 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.