@handijit/tr 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +46 -0
- package/LICENSE +21 -0
- package/README.md +1434 -2
- package/build/index.cjs +789 -0
- package/build/index.cjs.map +1 -0
- package/build/index.d.mts +136 -0
- package/build/index.d.ts +136 -0
- package/build/index.mjs +758 -0
- package/build/index.mjs.map +1 -0
- package/build/index.umd.js +2 -0
- package/build/index.umd.js.map +1 -0
- package/package.json +98 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../lib/helpers/describe-value.helper.ts","../lib/helpers/assert-string.helper.ts","../lib/modules/to-upper-case.ts","../lib/modules/capitalize.ts","../lib/modules/to-lower-case.ts","../lib/modules/compare-turkish.ts","../lib/modules/day-names.ts","../lib/modules/fold-text.ts","../lib/helpers/calendar.helper.ts","../lib/helpers/pad-number.helper.ts","../lib/helpers/zoned-date.helper.ts","../lib/modules/format-date.ts","../lib/modules/format-date-time.ts","../lib/helpers/strip-whitespace.helper.ts","../lib/helpers/iban.helper.ts","../lib/modules/format-iban.ts","../lib/helpers/assert-kurus.helper.ts","../lib/modules/format-money.ts","../lib/helpers/phone.helper.ts","../lib/modules/format-phone.ts","../lib/modules/get-day-name.ts","../lib/modules/month-names.ts","../lib/modules/get-month-name.ts","../lib/modules/get-phone-type.ts","../lib/modules/provinces.ts","../lib/modules/get-province-by-code.ts","../lib/modules/get-province-by-name.ts","../lib/modules/is-valid-iban.ts","../lib/modules/is-valid-license-plate.ts","../lib/modules/is-valid-phone.ts","../lib/modules/is-valid-tckn.ts","../lib/modules/is-valid-vkn.ts","../lib/modules/money-to-words.ts","../lib/modules/normalize-iban.ts","../lib/modules/normalize-phone.ts","../lib/modules/parse-date.ts","../lib/modules/parse-money.ts","../lib/modules/slugify.ts","../lib/modules/to-title-case.ts"],"sourcesContent":["/** Names a value for an error message; `typeof null` alone would say \"object\". */\nconst describeValue = (value: unknown): string =>\n value === null ? \"null\" : typeof value;\n\nexport default describeValue;\n","import describeValue from \"./describe-value.helper\";\n\ntype AssertString = (value: unknown, source: string) => asserts value is string;\n\n/** Throws when a required text argument is not a primitive string. */\nconst assertString: AssertString = (value, source) => {\n if (typeof value !== \"string\") {\n throw new TypeError(\n `${source}: expected a string, received ${describeValue(value)}`\n );\n }\n};\n\nexport default assertString;\n","import assertString from \"../helpers/assert-string.helper\";\n\nconst DOTTED_SMALL_I = /i/g;\n\n/** Upper-cases text by the Turkish rule: \"i\" becomes \"İ\" and \"ı\" becomes \"I\". */\nconst toUpperCase = (text: string): string => {\n assertString(text, \"toUpperCase\");\n // Only the dotted \"i\" differs from the default mapping (\"ı\" already maps to \"I\"), so the\n // result does not depend on the locale data the engine was built with.\n return text.replace(DOTTED_SMALL_I, \"İ\").toUpperCase();\n};\n\nexport default toUpperCase;\n","import assertString from \"../helpers/assert-string.helper\";\nimport toUpperCase from \"./to-upper-case\";\n\n/** Upper-cases the first letter by the Turkish rule and leaves the rest as written. */\nconst capitalize = (text: string): string => {\n assertString(text, \"capitalize\");\n const firstCodePoint = text.codePointAt(0);\n if (firstCodePoint === undefined) return \"\";\n\n // By code point, so a first character outside the BMP is not cut in half.\n const first = String.fromCodePoint(firstCodePoint);\n return toUpperCase(first) + text.slice(first.length);\n};\n\nexport default capitalize;\n","import assertString from \"../helpers/assert-string.helper\";\n\n// \"İ\" and its decomposed spelling \"I\" + combining dot above. The default mapping would turn\n// \"İ\" into \"i\" followed by a stray combining dot.\nconst DOTTED_CAPITAL_I = /İ|İ/g;\nconst DOTLESS_CAPITAL_I = /I/g;\n\n/** Lower-cases text by the Turkish rule: \"I\" becomes \"ı\" and \"İ\" becomes \"i\". */\nconst toLowerCase = (text: string): string => {\n assertString(text, \"toLowerCase\");\n return text\n .replace(DOTTED_CAPITAL_I, \"i\")\n .replace(DOTLESS_CAPITAL_I, \"ı\")\n .toLowerCase();\n};\n\nexport default toLowerCase;\n","import assertString from \"../helpers/assert-string.helper\";\nimport toLowerCase from \"./to-lower-case\";\n\n// The 29 letters in dictionary order, with q, w and x where Latin loanwords put them.\nconst ALPHABET = \"abcçdefgğhıijklmnoöpqrsştuüvwxyz\";\nconst COMBINING_MARK = /\\p{M}/u;\nconst FIRST_NON_ASCII = 128;\nconst DIGIT_ZERO = 48;\nconst DIGIT_NINE = 57;\n// Weight bands: ASCII punctuation, then digits, then letters, then every other character.\nconst DIGIT_BAND = 1_000;\nconst LETTER_BAND = 2_000;\nconst OTHER_BAND = 3_000;\n// A combining mark that survived composition weighs nothing at the letter level.\nconst IGNORED = -1;\n\nconst weightOf = (character: string): number => {\n const rank = ALPHABET.indexOf(character);\n if (rank >= 0) return LETTER_BAND + rank;\n\n const codePoint = character.codePointAt(0) as number;\n if (codePoint < FIRST_NON_ASCII) {\n return codePoint >= DIGIT_ZERO && codePoint <= DIGIT_NINE\n ? DIGIT_BAND + codePoint\n : codePoint;\n }\n if (COMBINING_MARK.test(character)) return IGNORED;\n\n // An accented letter sorts with its base letter (\"â\" with \"a\"); the accent only breaks ties.\n const baseRank = ALPHABET.indexOf(character.normalize(\"NFD\").charAt(0));\n return baseRank >= 0 ? LETTER_BAND + baseRank : OTHER_BAND + codePoint;\n};\n\nconst weigh = (text: string): number[] => {\n const weights: number[] = [];\n for (const character of text) {\n const weight = weightOf(character);\n if (weight !== IGNORED) weights.push(weight);\n }\n return weights;\n};\n\n// \"0\" for a character that is already lower case, \"1\" otherwise: lower case sorts first.\nconst caseKeyOf = (text: string): string => {\n let caseKey = \"\";\n for (const character of text) {\n caseKey += toLowerCase(character) === character ? \"0\" : \"1\";\n }\n return caseKey;\n};\n\n/**\n * Compares two texts in Turkish alphabetical order (\"ç\" after \"c\", \"ı\" before \"i\") for\n * `Array.prototype.sort`; case and accents only break ties, lower case first.\n */\nconst compareTurkish = (left: string, right: string): number => {\n assertString(left, \"compareTurkish\");\n assertString(right, \"compareTurkish\");\n\n // Composed form, so \"ö\" typed as \"o\" + diaeresis is the same letter.\n const leftText = left.normalize(\"NFC\");\n const rightText = right.normalize(\"NFC\");\n if (leftText === rightText) return 0;\n\n const leftLower = toLowerCase(leftText);\n const rightLower = toLowerCase(rightText);\n const leftWeights = weigh(leftLower);\n const rightWeights = weigh(rightLower);\n const sharedLength = Math.min(leftWeights.length, rightWeights.length);\n for (let i = 0; i < sharedLength; i += 1) {\n const difference = (leftWeights[i] as number) - (rightWeights[i] as number);\n if (difference !== 0) return difference < 0 ? -1 : 1;\n }\n if (leftWeights.length !== rightWeights.length) {\n return leftWeights.length < rightWeights.length ? -1 : 1;\n }\n\n // Same letters. An accent decides next (\"kar\" before \"kâr\"), then case (\"ali\" before \"Ali\").\n if (leftLower !== rightLower) return leftLower < rightLower ? -1 : 1;\n const leftCase = caseKeyOf(leftText);\n const rightCase = caseKeyOf(rightText);\n if (leftCase !== rightCase) return leftCase < rightCase ? -1 : 1;\n // Two capital forms of one letter (\"DŽ\" and \"Dž\"): code units keep the order total.\n return leftText < rightText ? -1 : 1;\n};\n\nexport default compareTurkish;\n","/**\n * Turkish day names, Monday first as on a Turkish calendar: `DAY_NAMES[0]` is \"Pazartesi\".\n * This is not the order of `Date.prototype.getDay`, where 0 is Sunday.\n */\nconst DAY_NAMES: readonly string[] = /* @__PURE__ */ Object.freeze([\n \"Pazartesi\",\n \"Salı\",\n \"Çarşamba\",\n \"Perşembe\",\n \"Cuma\",\n \"Cumartesi\",\n \"Pazar\",\n]);\n\nexport default DAY_NAMES;\n","import assertString from \"../helpers/assert-string.helper\";\nimport toLowerCase from \"./to-lower-case\";\n\nconst DOTLESS_SMALL_I = /ı/g;\nconst COMBINING_MARKS = /[̀-ͯ]/g;\n\n/** Folds text to a search key: Turkish lower case, then \"ç ğ ı ö ş ü\" and accents to plain letters. */\nconst foldText = (text: string): string => {\n assertString(text, \"foldText\");\n // \"ı\" has no decomposition, so it is mapped by hand; the other letters lose their marks.\n return toLowerCase(text)\n .replace(DOTLESS_SMALL_I, \"i\")\n .normalize(\"NFD\")\n .replace(COMBINING_MARKS, \"\");\n};\n\nexport default foldText;\n","const DAYS_IN_MONTH = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n\nconst isLeapYear = (year: number): boolean =>\n (year % 4 === 0 && year % 100 !== 0) || year % 400 === 0;\n\n/** Tells whether year, month and day name a day that exists (years 1 to 9999). */\nconst isRealDate = (year: number, month: number, day: number): boolean => {\n if (year < 1 || year > 9999 || month < 1 || month > 12 || day < 1) {\n return false;\n }\n const lastDay =\n month === 2 && isLeapYear(year) ? 29 : (DAYS_IN_MONTH[month - 1] as number);\n return day <= lastDay;\n};\n\nexport default isRealDate;\n","/** Left-pads a non-negative whole number with zeros: (7, 2) → \"07\". */\nconst padNumber = (value: number, length: number): string =>\n String(value).padStart(length, \"0\");\n\nexport default padNumber;\n","import isRealDate from \"./calendar.helper\";\nimport describeValue from \"./describe-value.helper\";\nimport padNumber from \"./pad-number.helper\";\n\ntype CalendarDate = {\n /** Calendar year, 1 to 9999. */\n year: number;\n /** Month of the year, 1 to 12. */\n month: number;\n /** Day of the month, 1 to 31. */\n day: number;\n};\n\ntype CalendarDateTime = CalendarDate & {\n /** Hour of the day, 0 to 23. */\n hour: number;\n /** Minute of the hour, 0 to 59. */\n minute: number;\n};\n\nconst DEFAULT_TIME_ZONE = \"Europe/Istanbul\";\nconst ISO_DATE_PATTERN = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\n// 0001-01-02T00:00Z and 9999-12-30T23:59:59.999Z. The one-day margin keeps the year inside\n// 1 to 9999 in every time zone, so the text never needs an era or a fifth year digit.\nconst MIN_TIMESTAMP = -62135510400000;\nconst MAX_TIMESTAMP = 253402214399999;\n// Building an Intl.DateTimeFormat costs far more than using one, so they are reused; the cap\n// keeps a caller that walks every zone from growing the cache without bound.\nconst MAX_CACHED_FORMATTERS = 8;\nconst MAX_ECHOED_LENGTH = 32;\n\nconst formatters = /* @__PURE__ */ new Map<string, Intl.DateTimeFormat>();\n\nconst getFormatter = (\n timeZone: string,\n source: string\n): Intl.DateTimeFormat => {\n const cached = formatters.get(timeZone);\n if (cached !== undefined) return cached;\n\n let formatter: Intl.DateTimeFormat;\n try {\n // Intl only moves the instant into the zone; the fixed locale, calendar, digits and hour\n // cycle make the parts plain numbers that read the same on every engine.\n formatter = new Intl.DateTimeFormat(\"en-US\", {\n timeZone,\n calendar: \"gregory\",\n numberingSystem: \"latn\",\n hourCycle: \"h23\",\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n });\n } catch {\n throw new RangeError(\n `${source}: unknown time zone \"${timeZone.slice(0, MAX_ECHOED_LENGTH)}\", expected an IANA name like \"Europe/Istanbul\"`\n );\n }\n\n if (formatters.size >= MAX_CACHED_FORMATTERS) {\n formatters.delete(formatters.keys().next().value as string);\n }\n formatters.set(timeZone, formatter);\n return formatter;\n};\n\nconst toTimestamp = (date: unknown, source: string): number => {\n let timestamp: number;\n if (typeof date === \"number\") {\n timestamp = date;\n } else {\n try {\n // Reads the internal time value, so a Date from another realm (an iframe, an Electron\n // context) passes and a look-alike object does not.\n timestamp = Date.prototype.getTime.call(date);\n } catch {\n throw new TypeError(\n `${source}: expected a Date or a timestamp in milliseconds, received ${describeValue(date)}`\n );\n }\n }\n\n if (Number.isNaN(timestamp)) {\n throw new RangeError(`${source}: received an invalid date`);\n }\n if (timestamp < MIN_TIMESTAMP || timestamp > MAX_TIMESTAMP) {\n throw new RangeError(\n `${source}: the date is outside the supported years 0001 to 9999`\n );\n }\n return timestamp;\n};\n\n/** Reads the wall-clock date and time an instant has in a time zone. */\nconst readInstant = (\n date: unknown,\n timeZone: unknown,\n source: string\n): CalendarDateTime => {\n const timestamp = toTimestamp(date, source);\n if (typeof timeZone !== \"string\") {\n throw new TypeError(\n `${source}: expected timeZone to be a string, received ${describeValue(timeZone)}`\n );\n }\n\n const fields: Record<string, string> = {};\n for (const part of getFormatter(timeZone, source).formatToParts(timestamp)) {\n fields[part.type] = part.value;\n }\n return {\n year: Number(fields.year),\n month: Number(fields.month),\n day: Number(fields.day),\n hour: Number(fields.hour),\n minute: Number(fields.minute),\n };\n};\n\n/**\n * Reads a calendar date: a \"yyyy-MM-dd\" string is taken as written (a business date has no\n * time zone), anything else is an instant read in `timeZone`.\n */\nconst readCalendarDate = (\n date: unknown,\n timeZone: unknown,\n source: string\n): CalendarDate => {\n if (typeof date !== \"string\") return readInstant(date, timeZone, source);\n\n const match = ISO_DATE_PATTERN.exec(date);\n if (match !== null) {\n const year = Number(match[1]);\n const month = Number(match[2]);\n const day = Number(match[3]);\n if (isRealDate(year, month, day)) return { year, month, day };\n }\n throw new RangeError(\n `${source}: expected a real calendar date like \"2026-11-10\", received \"${date.slice(0, MAX_ECHOED_LENGTH)}\"`\n );\n};\n\n/** Writes a calendar date as \"dd.MM.yyyy\". */\nconst toDottedDate = ({ year, month, day }: CalendarDate): string =>\n `${padNumber(day, 2)}.${padNumber(month, 2)}.${padNumber(year, 4)}`;\n\nexport type { CalendarDate, CalendarDateTime };\nexport { DEFAULT_TIME_ZONE, readCalendarDate, readInstant, toDottedDate };\n","import {\n DEFAULT_TIME_ZONE,\n readCalendarDate,\n toDottedDate,\n} from \"../helpers/zoned-date.helper\";\nimport type { TimeZoneOptions } from \"../types\";\n\n/**\n * Writes a date as \"dd.MM.yyyy\". A `Date` or a timestamp is read in `timeZone`; a\n * \"yyyy-MM-dd\" string is a calendar date already and is written as it stands.\n */\nconst formatDate = (\n date: Date | number | string,\n { timeZone = DEFAULT_TIME_ZONE }: TimeZoneOptions = {}\n): string => toDottedDate(readCalendarDate(date, timeZone, \"formatDate\"));\n\nexport default formatDate;\n","import padNumber from \"../helpers/pad-number.helper\";\nimport {\n DEFAULT_TIME_ZONE,\n readInstant,\n toDottedDate,\n} from \"../helpers/zoned-date.helper\";\nimport type { TimeZoneOptions } from \"../types\";\n\n/** Writes an instant as \"dd.MM.yyyy HH:mm\" on the 24-hour clock of `timeZone`. */\nconst formatDateTime = (\n date: Date | number,\n { timeZone = DEFAULT_TIME_ZONE }: TimeZoneOptions = {}\n): string => {\n const instant = readInstant(date, timeZone, \"formatDateTime\");\n return `${toDottedDate(instant)} ${padNumber(instant.hour, 2)}:${padNumber(instant.minute, 2)}`;\n};\n\nexport default formatDateTime;\n","const WHITESPACE = /\\s+/g;\n\n/** Drops every whitespace character, including the no-break spaces of pasted text. */\nconst stripWhitespace = (value: string): string =>\n value.replace(WHITESPACE, \"\");\n\nexport default stripWhitespace;\n","import stripWhitespace from \"./strip-whitespace.helper\";\n\nconst TR_IBAN_PATTERN = /^TR\\d{24}$/;\n// \"TR\" as IBAN letter values: T = 29, R = 27.\nconst COUNTRY_DIGITS = \"2927\";\nconst DIGIT_ZERO = 48;\n\n/** Returns the compact upper-case form of a valid Turkish IBAN, or `null`. */\nconst parseIban = (value: string): string | null => {\n const iban = stripWhitespace(value).toUpperCase();\n if (!TR_IBAN_PATTERN.test(iban)) return null;\n\n // ISO 13616: move the first four characters to the end and read the result as one number mod 97.\n // The number has 30 digits, so the remainder is carried digit by digit instead of parsing it.\n const rearranged = `${iban.slice(4)}${COUNTRY_DIGITS}${iban.slice(2, 4)}`;\n let remainder = 0;\n for (let i = 0; i < rearranged.length; i += 1) {\n remainder = (remainder * 10 + rearranged.charCodeAt(i) - DIGIT_ZERO) % 97;\n }\n return remainder === 1 ? iban : null;\n};\n\nexport default parseIban;\n","import assertString from \"../helpers/assert-string.helper\";\nimport parseIban from \"../helpers/iban.helper\";\n\nconst FOUR_CHARACTERS = /.{4}(?=.)/g;\n\n/** Returns a valid Turkish IBAN in printed groups of four (\"TR33 0006 1005 …\"), or `null`. */\nconst formatIban = (value: string): string | null => {\n assertString(value, \"formatIban\");\n const iban = parseIban(value);\n return iban === null ? null : iban.replace(FOUR_CHARACTERS, \"$& \");\n};\n\nexport default formatIban;\n","import describeValue from \"./describe-value.helper\";\n\ntype AssertKurus = (value: unknown, source: string) => asserts value is number;\n\n/** Throws unless the amount is a whole number of kuruş that a double holds exactly. */\nconst assertKurus: AssertKurus = (value, source) => {\n if (typeof value !== \"number\") {\n throw new TypeError(\n `${source}: expected an amount in kuruş as a number, received ${describeValue(value)}`\n );\n }\n // A fraction or an unsafe integer has already lost kuruş; printing it would invent an amount.\n if (!Number.isSafeInteger(value)) {\n throw new RangeError(\n `${source}: expected a whole number of kuruş within the safe integer range, received ${value}`\n );\n }\n};\n\nexport default assertKurus;\n","import assertKurus from \"../helpers/assert-kurus.helper\";\nimport padNumber from \"../helpers/pad-number.helper\";\n\ntype FormatMoneyOptions = {\n /** Write the lira sign before the amount (\"₺3.490,00\") instead of \"TL\" after it. Defaults to `false`. */\n symbol?: boolean;\n};\n\nconst GROUP_SIZE = 3;\n\nconst groupThousands = (digits: string): string => {\n let grouped = \"\";\n for (let end = digits.length; end > 0; end -= GROUP_SIZE) {\n const group = digits.slice(Math.max(0, end - GROUP_SIZE), end);\n grouped = grouped === \"\" ? group : `${group}.${grouped}`;\n }\n return grouped;\n};\n\n/** Writes an amount held in whole kuruş as Turkish lira: 349000 → \"3.490,00 TL\". */\nconst formatMoney = (\n kurus: number,\n { symbol = false }: FormatMoneyOptions = {}\n): string => {\n assertKurus(kurus, \"formatMoney\");\n\n const absolute = Math.abs(kurus);\n // Remainder first, then an exact subtraction: dividing a large amount by 100 directly\n // rounds, and a rounded lira part would print a different number.\n const kurusPart = absolute % 100;\n const liraPart = (absolute - kurusPart) / 100;\n const amount = `${groupThousands(String(liraPart))},${padNumber(kurusPart, 2)}`;\n // `kurus < 0` is false for -0, so a zero never carries a sign.\n const sign = kurus < 0 ? \"-\" : \"\";\n return symbol === true ? `${sign}₺${amount}` : `${sign}${amount} TL`;\n};\n\nexport type { FormatMoneyOptions };\nexport default formatMoney;\n","import type { PhoneType } from \"../types\";\n\nconst ALLOWED_CHARACTERS = /^\\+?[\\d\\s().-]+$/;\nconst NON_DIGITS = /\\D/g;\n// With \"+\" the country code is mandatory; without it the trunk \"0\", \"90\" and \"0090\" are optional.\nconst INTERNATIONAL_DIGITS = /^90([2-58]\\d{9})$/;\nconst DOMESTIC_DIGITS = /^(?:0090|90|0)?([2-58]\\d{9})$/;\n\ntype ParsedPhone = {\n /** The ten-digit national number: area code and subscriber number. */\n national: string;\n /** What the first digit of the national number says about the line. */\n type: PhoneType;\n};\n\nconst typeOf = (national: string): PhoneType => {\n const leadingDigit = national.charAt(0);\n if (leadingDigit === \"5\") return \"mobile\";\n if (leadingDigit === \"8\") return \"nonGeographic\";\n return \"landline\";\n};\n\n/** Reads a Turkish phone number in any common spelling, or returns `null`. */\nconst parsePhone = (value: string): ParsedPhone | null => {\n const trimmed = value.trim();\n if (!ALLOWED_CHARACTERS.test(trimmed)) return null;\n\n const digits = trimmed.replace(NON_DIGITS, \"\");\n const pattern = trimmed.startsWith(\"+\")\n ? INTERNATIONAL_DIGITS\n : DOMESTIC_DIGITS;\n const national = pattern.exec(digits)?.[1];\n if (national === undefined) return null;\n\n return { national, type: typeOf(national) };\n};\n\nexport type { ParsedPhone };\nexport default parsePhone;\n","import assertString from \"../helpers/assert-string.helper\";\nimport parsePhone from \"../helpers/phone.helper\";\n\ntype FormatPhoneOptions = {\n /** \"national\" writes \"0 (532) 123 45 67\", \"international\" writes \"+90 532 123 45 67\". Defaults to \"national\". */\n style?: \"national\" | \"international\";\n};\n\n/** Returns a Turkish phone number in its printed form, or `null`. */\nconst formatPhone = (\n value: string,\n { style = \"national\" }: FormatPhoneOptions = {}\n): string | null => {\n assertString(value, \"formatPhone\");\n const phone = parsePhone(value);\n if (phone === null) return null;\n\n const areaCode = phone.national.slice(0, 3);\n const subscriber = `${phone.national.slice(3, 6)} ${phone.national.slice(6, 8)} ${phone.national.slice(8)}`;\n // Any style other than \"international\" is the documented default, never a third layout.\n return style === \"international\"\n ? `+90 ${areaCode} ${subscriber}`\n : `0 (${areaCode}) ${subscriber}`;\n};\n\nexport type { FormatPhoneOptions };\nexport default formatPhone;\n","import {\n DEFAULT_TIME_ZONE,\n readCalendarDate,\n} from \"../helpers/zoned-date.helper\";\nimport type { TimeZoneOptions } from \"../types\";\nimport DAY_NAMES from \"./day-names\";\n\n/** Returns the Turkish name of the day of the week a date falls on, such as \"Salı\". */\nconst getDayName = (\n date: Date | number | string,\n { timeZone = DEFAULT_TIME_ZONE }: TimeZoneOptions = {}\n): string => {\n const { year, month, day } = readCalendarDate(date, timeZone, \"getDayName\");\n // setUTCFullYear, because Date.UTC reads the years 0 to 99 as 1900 to 1999.\n const calendarDay = new Date(0);\n calendarDay.setUTCFullYear(year, month - 1, day);\n // getUTCDay counts from Sunday, DAY_NAMES from Monday.\n return DAY_NAMES[(calendarDay.getUTCDay() + 6) % 7] as string;\n};\n\nexport default getDayName;\n","/** Turkish month names, January first: `MONTH_NAMES[0]` is \"Ocak\". */\nconst MONTH_NAMES: readonly string[] = /* @__PURE__ */ Object.freeze([\n \"Ocak\",\n \"Şubat\",\n \"Mart\",\n \"Nisan\",\n \"Mayıs\",\n \"Haziran\",\n \"Temmuz\",\n \"Ağustos\",\n \"Eylül\",\n \"Ekim\",\n \"Kasım\",\n \"Aralık\",\n]);\n\nexport default MONTH_NAMES;\n","import {\n DEFAULT_TIME_ZONE,\n readCalendarDate,\n} from \"../helpers/zoned-date.helper\";\nimport type { TimeZoneOptions } from \"../types\";\nimport MONTH_NAMES from \"./month-names\";\n\n/** Returns the Turkish name of the month a date falls in, such as \"Kasım\". */\nconst getMonthName = (\n date: Date | number | string,\n { timeZone = DEFAULT_TIME_ZONE }: TimeZoneOptions = {}\n): string => {\n const { month } = readCalendarDate(date, timeZone, \"getMonthName\");\n return MONTH_NAMES[month - 1] as string;\n};\n\nexport default getMonthName;\n","import assertString from \"../helpers/assert-string.helper\";\nimport parsePhone from \"../helpers/phone.helper\";\nimport type { PhoneType } from \"../types\";\n\n/** Tells a mobile number (5XX) from a landline (2XX to 4XX) and a service number (8XX), or returns `null`. */\nconst getPhoneType = (value: string): PhoneType | null => {\n assertString(value, \"getPhoneType\");\n return parsePhone(value)?.type ?? null;\n};\n\nexport default getPhoneType;\n","import type { Province } from \"../types\";\n\n// In plate-code order: the name at index 0 belongs to code 01.\nconst PROVINCE_NAMES = [\n \"Adana\",\n \"Adıyaman\",\n \"Afyonkarahisar\",\n \"Ağrı\",\n \"Amasya\",\n \"Ankara\",\n \"Antalya\",\n \"Artvin\",\n \"Aydın\",\n \"Balıkesir\",\n \"Bilecik\",\n \"Bingöl\",\n \"Bitlis\",\n \"Bolu\",\n \"Burdur\",\n \"Bursa\",\n \"Çanakkale\",\n \"Çankırı\",\n \"Çorum\",\n \"Denizli\",\n \"Diyarbakır\",\n \"Edirne\",\n \"Elazığ\",\n \"Erzincan\",\n \"Erzurum\",\n \"Eskişehir\",\n \"Gaziantep\",\n \"Giresun\",\n \"Gümüşhane\",\n \"Hakkari\",\n \"Hatay\",\n \"Isparta\",\n \"Mersin\",\n \"İstanbul\",\n \"İzmir\",\n \"Kars\",\n \"Kastamonu\",\n \"Kayseri\",\n \"Kırklareli\",\n \"Kırşehir\",\n \"Kocaeli\",\n \"Konya\",\n \"Kütahya\",\n \"Malatya\",\n \"Manisa\",\n \"Kahramanmaraş\",\n \"Mardin\",\n \"Muğla\",\n \"Muş\",\n \"Nevşehir\",\n \"Niğde\",\n \"Ordu\",\n \"Rize\",\n \"Sakarya\",\n \"Samsun\",\n \"Siirt\",\n \"Sinop\",\n \"Sivas\",\n \"Tekirdağ\",\n \"Tokat\",\n \"Trabzon\",\n \"Tunceli\",\n \"Şanlıurfa\",\n \"Uşak\",\n \"Van\",\n \"Yozgat\",\n \"Zonguldak\",\n \"Aksaray\",\n \"Bayburt\",\n \"Karaman\",\n \"Kırıkkale\",\n \"Batman\",\n \"Şırnak\",\n \"Bartın\",\n \"Ardahan\",\n \"Iğdır\",\n \"Yalova\",\n \"Karabük\",\n \"Kilis\",\n \"Osmaniye\",\n \"Düzce\",\n];\n\n// Frozen all the way down: every consumer shares this one list, so nobody may edit it.\nconst buildProvinces = (): readonly Province[] =>\n Object.freeze(\n PROVINCE_NAMES.map((name, index) =>\n Object.freeze({ code: index + 1, name })\n )\n );\n\n/** The 81 provinces of Turkey in plate-code order: `PROVINCES[0]` is Adana, code 1. */\nconst PROVINCES: readonly Province[] = /* @__PURE__ */ buildProvinces();\n\nexport default PROVINCES;\n","import describeValue from \"../helpers/describe-value.helper\";\nimport type { Province } from \"../types\";\nimport PROVINCES from \"./provinces\";\n\nconst CODE_PATTERN = /^\\d{1,2}$/;\n\n/** Finds a province by its plate code, given as a number (6) or as text (\"06\"), or returns `null`. */\nconst getProvinceByCode = (code: number | string): Province | null => {\n if (typeof code === \"string\") {\n const text = code.trim();\n return CODE_PATTERN.test(text)\n ? (PROVINCES[Number(text) - 1] ?? null)\n : null;\n }\n if (typeof code !== \"number\") {\n throw new TypeError(\n `getProvinceByCode: expected a plate code as a number or a string, received ${describeValue(code)}`\n );\n }\n // A fraction, NaN or a code outside 1 to 81 names no index of the list.\n return PROVINCES[code - 1] ?? null;\n};\n\nexport default getProvinceByCode;\n","import assertString from \"../helpers/assert-string.helper\";\nimport type { Province } from \"../types\";\nimport foldText from \"./fold-text\";\nimport PROVINCES from \"./provinces\";\n\n// Built on the first lookup and never grown: 81 entries. Building it at import time would\n// run code in every bundle that merely imports the package.\nlet provincesByFoldedName: Map<string, Province> | undefined;\n\n/**\n * Finds a province by name without regard to case or Turkish letters (\"istanbul\", \"ISTANBUL\"\n * and \"İstanbul\" all match), or returns `null`.\n */\nconst getProvinceByName = (name: string): Province | null => {\n assertString(name, \"getProvinceByName\");\n\n provincesByFoldedName ??= new Map(\n PROVINCES.map((province) => [foldText(province.name), province])\n );\n return provincesByFoldedName.get(foldText(name.trim())) ?? null;\n};\n\nexport default getProvinceByName;\n","import parseIban from \"../helpers/iban.helper\";\n\n/** Checks a Turkish IBAN: \"TR\", 24 digits and the ISO 13616 mod-97 checksum. */\nconst isValidIban = (value: unknown): boolean =>\n typeof value === \"string\" && parseIban(value) !== null;\n\nexport default isValidIban;\n","// Province code 01 to 81, then one of the six civil layouts: one letter with four or five\n// digits, two letters with three or four, three letters with two or three. Plates use the\n// 23 letters left after Ç, Ğ, İ, Ö, Ş, Ü and Q, W, X are taken out.\nconst LICENSE_PLATE_PATTERN =\n /^(?:0[1-9]|[1-7]\\d|8[01])\\s*(?:[A-PR-VYZa-pr-vyz]\\s*\\d{4,5}|[A-PR-VYZa-pr-vyz]{2}\\s*\\d{3,4}|[A-PR-VYZa-pr-vyz]{3}\\s*\\d{2,3})$/;\n\n/**\n * Checks that a value has the shape of a civil Turkish licence plate (\"34 ABC 123\"). Only\n * the shape is checked: whether the plate was ever issued is not something a format can tell.\n */\nconst isValidLicensePlate = (value: unknown): boolean =>\n typeof value === \"string\" && LICENSE_PLATE_PATTERN.test(value.trim());\n\nexport default isValidLicensePlate;\n","import parsePhone from \"../helpers/phone.helper\";\n\n/** Checks that a value is a Turkish mobile, landline or 8XX service number. */\nconst isValidPhone = (value: unknown): boolean =>\n typeof value === \"string\" && parsePhone(value) !== null;\n\nexport default isValidPhone;\n","import stripWhitespace from \"../helpers/strip-whitespace.helper\";\n\nconst TCKN_PATTERN = /^[1-9]\\d{10}$/;\nconst DIGIT_ZERO = 48;\n\n/** Checks the two check digits of a T.C. identity number (11 digits, the first not 0). */\nconst isValidTckn = (value: unknown): boolean => {\n if (typeof value !== \"string\") return false;\n const tckn = stripWhitespace(value);\n if (!TCKN_PATTERN.test(tckn)) return false;\n\n const digitAt = (index: number): number =>\n tckn.charCodeAt(index) - DIGIT_ZERO;\n const oddSum = digitAt(0) + digitAt(2) + digitAt(4) + digitAt(6) + digitAt(8);\n const evenSum = digitAt(1) + digitAt(3) + digitAt(5) + digitAt(7);\n // The subtraction can go below zero; a plain % would then hand back a negative digit.\n const tenth = (((oddSum * 7 - evenSum) % 10) + 10) % 10;\n const eleventh = (oddSum + evenSum + digitAt(9)) % 10;\n return digitAt(9) === tenth && digitAt(10) === eleventh;\n};\n\nexport default isValidTckn;\n","import stripWhitespace from \"../helpers/strip-whitespace.helper\";\n\nconst VKN_PATTERN = /^\\d{10}$/;\nconst DIGIT_ZERO = 48;\n\n/** Checks the check digit of a tax identification number (VKN, 10 digits). */\nconst isValidVkn = (value: unknown): boolean => {\n if (typeof value !== \"string\") return false;\n const vkn = stripWhitespace(value);\n if (!VKN_PATTERN.test(vkn)) return false;\n\n let sum = 0;\n for (let i = 0; i < 9; i += 1) {\n const shifted = (vkn.charCodeAt(i) - DIGIT_ZERO + 9 - i) % 10;\n const weighted = (shifted * 2 ** (9 - i)) % 9;\n // A shifted 9 is a multiple of nine; the algorithm counts it as 9, not as 0.\n sum += shifted !== 0 && weighted === 0 ? 9 : weighted;\n }\n return (10 - (sum % 10)) % 10 === vkn.charCodeAt(9) - DIGIT_ZERO;\n};\n\nexport default isValidVkn;\n","import assertKurus from \"../helpers/assert-kurus.helper\";\n\nconst ONES = [\n \"\",\n \"bir\",\n \"iki\",\n \"üç\",\n \"dört\",\n \"beş\",\n \"altı\",\n \"yedi\",\n \"sekiz\",\n \"dokuz\",\n];\nconst TENS = [\n \"\",\n \"on\",\n \"yirmi\",\n \"otuz\",\n \"kırk\",\n \"elli\",\n \"altmış\",\n \"yetmiş\",\n \"seksen\",\n \"doksan\",\n];\n// The largest safe amount is about 90 trilyon lira, so the list never runs out.\nconst SCALES = [\"\", \"bin\", \"milyon\", \"milyar\", \"trilyon\"];\n\nconst groupToWords = (group: number): string[] => {\n const hundreds = Math.floor(group / 100);\n const tens = Math.floor((group % 100) / 10);\n const ones = group % 10;\n\n const words: string[] = [];\n // Turkish says \"yüz\", never \"bir yüz\".\n if (hundreds > 1) words.push(ONES[hundreds] as string);\n if (hundreds > 0) words.push(\"yüz\");\n if (tens > 0) words.push(TENS[tens] as string);\n if (ones > 0) words.push(ONES[ones] as string);\n return words;\n};\n\nconst numberToWords = (value: number): string => {\n if (value === 0) return \"sıfır\";\n\n const words: string[] = [];\n let remaining = value;\n for (let scale = 0; remaining > 0; scale += 1) {\n const group = remaining % 1000;\n remaining = (remaining - group) / 1000;\n if (group === 0) continue;\n\n const groupWords = groupToWords(group);\n // \"bin\", never \"bir bin\"; every larger scale keeps its \"bir\" (\"bir milyon\").\n if (scale === 1 && group === 1) groupWords.length = 0;\n if (scale > 0) groupWords.push(SCALES[scale] as string);\n words.unshift(...groupWords);\n }\n return words.join(\" \");\n};\n\n/**\n * Writes an amount held in whole kuruş in Turkish words, the way an invoice spells it:\n * 349050 → \"üç bin dört yüz doksan Türk lirası elli kuruş\".\n */\nconst moneyToWords = (kurus: number): string => {\n assertKurus(kurus, \"moneyToWords\");\n\n const absolute = Math.abs(kurus);\n const kurusPart = absolute % 100;\n const liraPart = (absolute - kurusPart) / 100;\n\n const parts: string[] = [];\n if (kurus < 0) parts.push(\"eksi\");\n // An amount below one lira is read by its kuruş alone; zero still needs a unit to stand on.\n if (liraPart > 0 || kurusPart === 0) {\n parts.push(`${numberToWords(liraPart)} Türk lirası`);\n }\n if (kurusPart > 0) parts.push(`${numberToWords(kurusPart)} kuruş`);\n return parts.join(\" \");\n};\n\nexport default moneyToWords;\n","import assertString from \"../helpers/assert-string.helper\";\nimport parseIban from \"../helpers/iban.helper\";\n\n/** Returns the storage form of a valid Turkish IBAN (upper case, no spaces), or `null`. */\nconst normalizeIban = (value: string): string | null => {\n assertString(value, \"normalizeIban\");\n return parseIban(value);\n};\n\nexport default normalizeIban;\n","import assertString from \"../helpers/assert-string.helper\";\nimport parsePhone from \"../helpers/phone.helper\";\n\n/** Returns a Turkish phone number in E.164 form (\"+905321234567\"), or `null`. */\nconst normalizePhone = (value: string): string | null => {\n assertString(value, \"normalizePhone\");\n const phone = parsePhone(value);\n return phone === null ? null : `+90${phone.national}`;\n};\n\nexport default normalizePhone;\n","import assertString from \"../helpers/assert-string.helper\";\nimport isRealDate from \"../helpers/calendar.helper\";\nimport padNumber from \"../helpers/pad-number.helper\";\n\nconst DOTTED_DATE_PATTERN = /^(\\d{1,2})\\.(\\d{1,2})\\.(\\d{4})$/;\n\n/**\n * Reads a \"dd.MM.yyyy\" date into the ISO calendar date \"yyyy-MM-dd\", or returns `null` when\n * the text is not a date or names a day that does not exist (31.02.2026).\n */\nconst parseDate = (text: string): string | null => {\n assertString(text, \"parseDate\");\n\n const match = DOTTED_DATE_PATTERN.exec(text.trim());\n if (match === null) return null;\n\n const day = Number(match[1]);\n const month = Number(match[2]);\n const year = Number(match[3]);\n if (!isRealDate(year, month, day)) return null;\n\n return `${padNumber(year, 4)}-${padNumber(month, 2)}-${padNumber(day, 2)}`;\n};\n\nexport default parseDate;\n","import assertString from \"../helpers/assert-string.helper\";\nimport stripWhitespace from \"../helpers/strip-whitespace.helper\";\n\n// sign, currency, sign, lira (grouped by dots or plain), kuruş after a comma, currency.\n// The lira part takes dots only as complete thousands groups: \"1.250\" is 1250 lira, while\n// \"1250.50\" is not read at all, because guessing what that dot means would invent money.\nconst MONEY_PATTERN =\n /^([+\\-−]?)(₺|[Tt][Ll]|[Tt][Rr][Yy])?([+\\-−]?)([1-9]\\d{0,2}(?:\\.\\d{3})+|\\d+)(?:,(\\d{1,2}))?(₺|[Tt][Ll]|[Tt][Rr][Yy])?$/;\nconst DOTS = /\\./g;\n\n/** Reads a Turkish-formatted amount into whole kuruş: \"3.490,50\" → 349050, or `null`. */\nconst parseMoney = (text: string): number | null => {\n assertString(text, \"parseMoney\");\n\n const match = MONEY_PATTERN.exec(stripWhitespace(text));\n if (match === null) return null;\n\n // The two sign groups always take part in a match, as an empty string when no sign is written.\n const outerSign = match[1] as string;\n const innerSign = match[3] as string;\n const lira = match[4] as string;\n const kurus = match[5] ?? \"\";\n if (outerSign !== \"\" && innerSign !== \"\") return null;\n if (match[2] !== undefined && match[6] !== undefined) return null;\n\n // Digits are joined as text and converted once, so no float arithmetic touches the amount.\n const amount = Number(lira.replace(DOTS, \"\") + kurus.padEnd(2, \"0\"));\n if (!Number.isSafeInteger(amount)) return null;\n\n const sign = outerSign + innerSign;\n // A negative zero would print as \"-0\" in some places and equal 0 in others.\n return sign !== \"\" && sign !== \"+\" && amount !== 0 ? -amount : amount;\n};\n\nexport default parseMoney;\n","import assertString from \"../helpers/assert-string.helper\";\nimport foldText from \"./fold-text\";\n\nconst NON_SLUG_CHARACTERS = /[^a-z0-9]+/g;\n// After the pass above a slug holds single hyphens only, so at most one sits at each end.\nconst EDGE_HYPHENS = /^-|-$/g;\n\n/** Builds a URL and file name safe slug: \"Şırnak İl Özel İdaresi\" → \"sirnak-il-ozel-idaresi\". */\nconst slugify = (text: string): string => {\n assertString(text, \"slugify\");\n return foldText(text)\n .replace(NON_SLUG_CHARACTERS, \"-\")\n .replace(EDGE_HYPHENS, \"\");\n};\n\nexport default slugify;\n","import assertString from \"../helpers/assert-string.helper\";\nimport toLowerCase from \"./to-lower-case\";\nimport toUpperCase from \"./to-upper-case\";\n\n// A letter that starts a word: nothing before it, or something that is not a letter, a digit,\n// a combining mark (a decomposed \"ü\" must not split its word) or an apostrophe (\"Ankara'da\").\nconst WORD_START = /(?<![\\p{L}\\p{N}\\p{M}'’])\\p{L}/gu;\n\n/** Writes every word with a Turkish upper-case first letter and lower-case rest. */\nconst toTitleCase = (text: string): string => {\n assertString(text, \"toTitleCase\");\n return toLowerCase(text).replace(WORD_START, toUpperCase);\n};\n\nexport default toTitleCase;\n"],"names":["DIGIT_ZERO"],"mappings":";;AAAA;AACA,MAAM,aAAa,GAAG,CAAC,KAAc,KACnC,KAAK,KAAK,IAAI,GAAG,MAAM,GAAG,OAAO,KAAK;;ACExC;AACA,MAAM,YAAY,GAAiB,CAAC,KAAK,EAAE,MAAM,KAAI;AACnD,IAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,QAAA,MAAM,IAAI,SAAS,CACjB,CAAA,EAAG,MAAM,CAAA,8BAAA,EAAiC,aAAa,CAAC,KAAK,CAAC,CAAA,CAAE,CACjE;IACH;AACF,CAAC;;ACTD,MAAM,cAAc,GAAG,IAAI;AAE3B;AACA,MAAM,WAAW,GAAG,CAAC,IAAY,KAAY;AAC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C7B,OAAO,QAAQ,CAAC,IAAI;AACjB,SAAA,OAAO,CAAC,mBAAmB,EAAE,GAAG;AAChC,SAAA,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;AAC9B;;ACTA;AACA;AACA,MAAM,UAAU,GAAG,iCAAiC;AAEpD;AACA,MAAM,WAAW,GAAG,CAAC,IAAY,KAAY;AAC3C,IAAA,YAAY,CAAC,IAAI,EAAE,aAAa,CAAC;IACjC,OAAO,WAAW,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC;AAC3D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/** Upper-cases the first letter by the Turkish rule and leaves the rest as written. */
|
|
2
|
+
declare const capitalize: (text: string) => string;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Compares two texts in Turkish alphabetical order ("ç" after "c", "ı" before "i") for
|
|
6
|
+
* `Array.prototype.sort`; case and accents only break ties, lower case first.
|
|
7
|
+
*/
|
|
8
|
+
declare const compareTurkish: (left: string, right: string) => number;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Turkish day names, Monday first as on a Turkish calendar: `DAY_NAMES[0]` is "Pazartesi".
|
|
12
|
+
* This is not the order of `Date.prototype.getDay`, where 0 is Sunday.
|
|
13
|
+
*/
|
|
14
|
+
declare const DAY_NAMES: readonly string[];
|
|
15
|
+
|
|
16
|
+
/** Folds text to a search key: Turkish lower case, then "ç ğ ı ö ş ü" and accents to plain letters. */
|
|
17
|
+
declare const foldText: (text: string) => string;
|
|
18
|
+
|
|
19
|
+
/** One of the 81 provinces of Turkey. */
|
|
20
|
+
type Province = {
|
|
21
|
+
/** Licence plate code, 1 to 81. */
|
|
22
|
+
readonly code: number;
|
|
23
|
+
/** Official name in Turkish spelling, such as "İstanbul". */
|
|
24
|
+
readonly name: string;
|
|
25
|
+
};
|
|
26
|
+
/** What a Turkish phone number is, decided by the first digit of its national number. */
|
|
27
|
+
type PhoneType = "mobile" | "landline" | "nonGeographic";
|
|
28
|
+
/** Option shared by every function that reads a calendar date off an instant. */
|
|
29
|
+
type TimeZoneOptions = {
|
|
30
|
+
/** IANA time zone the instant is read in. Defaults to "Europe/Istanbul". */
|
|
31
|
+
timeZone?: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Writes a date as "dd.MM.yyyy". A `Date` or a timestamp is read in `timeZone`; a
|
|
36
|
+
* "yyyy-MM-dd" string is a calendar date already and is written as it stands.
|
|
37
|
+
*/
|
|
38
|
+
declare const formatDate: (date: Date | number | string, { timeZone }?: TimeZoneOptions) => string;
|
|
39
|
+
|
|
40
|
+
/** Writes an instant as "dd.MM.yyyy HH:mm" on the 24-hour clock of `timeZone`. */
|
|
41
|
+
declare const formatDateTime: (date: Date | number, { timeZone }?: TimeZoneOptions) => string;
|
|
42
|
+
|
|
43
|
+
/** Returns a valid Turkish IBAN in printed groups of four ("TR33 0006 1005 …"), or `null`. */
|
|
44
|
+
declare const formatIban: (value: string) => string | null;
|
|
45
|
+
|
|
46
|
+
type FormatMoneyOptions = {
|
|
47
|
+
/** Write the lira sign before the amount ("₺3.490,00") instead of "TL" after it. Defaults to `false`. */
|
|
48
|
+
symbol?: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** Writes an amount held in whole kuruş as Turkish lira: 349000 → "3.490,00 TL". */
|
|
51
|
+
declare const formatMoney: (kurus: number, { symbol }?: FormatMoneyOptions) => string;
|
|
52
|
+
|
|
53
|
+
type FormatPhoneOptions = {
|
|
54
|
+
/** "national" writes "0 (532) 123 45 67", "international" writes "+90 532 123 45 67". Defaults to "national". */
|
|
55
|
+
style?: "national" | "international";
|
|
56
|
+
};
|
|
57
|
+
/** Returns a Turkish phone number in its printed form, or `null`. */
|
|
58
|
+
declare const formatPhone: (value: string, { style }?: FormatPhoneOptions) => string | null;
|
|
59
|
+
|
|
60
|
+
/** Returns the Turkish name of the day of the week a date falls on, such as "Salı". */
|
|
61
|
+
declare const getDayName: (date: Date | number | string, { timeZone }?: TimeZoneOptions) => string;
|
|
62
|
+
|
|
63
|
+
/** Returns the Turkish name of the month a date falls in, such as "Kasım". */
|
|
64
|
+
declare const getMonthName: (date: Date | number | string, { timeZone }?: TimeZoneOptions) => string;
|
|
65
|
+
|
|
66
|
+
/** Tells a mobile number (5XX) from a landline (2XX to 4XX) and a service number (8XX), or returns `null`. */
|
|
67
|
+
declare const getPhoneType: (value: string) => PhoneType | null;
|
|
68
|
+
|
|
69
|
+
/** Finds a province by its plate code, given as a number (6) or as text ("06"), or returns `null`. */
|
|
70
|
+
declare const getProvinceByCode: (code: number | string) => Province | null;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Finds a province by name without regard to case or Turkish letters ("istanbul", "ISTANBUL"
|
|
74
|
+
* and "İstanbul" all match), or returns `null`.
|
|
75
|
+
*/
|
|
76
|
+
declare const getProvinceByName: (name: string) => Province | null;
|
|
77
|
+
|
|
78
|
+
/** Checks a Turkish IBAN: "TR", 24 digits and the ISO 13616 mod-97 checksum. */
|
|
79
|
+
declare const isValidIban: (value: unknown) => boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Checks that a value has the shape of a civil Turkish licence plate ("34 ABC 123"). Only
|
|
83
|
+
* the shape is checked: whether the plate was ever issued is not something a format can tell.
|
|
84
|
+
*/
|
|
85
|
+
declare const isValidLicensePlate: (value: unknown) => boolean;
|
|
86
|
+
|
|
87
|
+
/** Checks that a value is a Turkish mobile, landline or 8XX service number. */
|
|
88
|
+
declare const isValidPhone: (value: unknown) => boolean;
|
|
89
|
+
|
|
90
|
+
/** Checks the two check digits of a T.C. identity number (11 digits, the first not 0). */
|
|
91
|
+
declare const isValidTckn: (value: unknown) => boolean;
|
|
92
|
+
|
|
93
|
+
/** Checks the check digit of a tax identification number (VKN, 10 digits). */
|
|
94
|
+
declare const isValidVkn: (value: unknown) => boolean;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Writes an amount held in whole kuruş in Turkish words, the way an invoice spells it:
|
|
98
|
+
* 349050 → "üç bin dört yüz doksan Türk lirası elli kuruş".
|
|
99
|
+
*/
|
|
100
|
+
declare const moneyToWords: (kurus: number) => string;
|
|
101
|
+
|
|
102
|
+
/** Turkish month names, January first: `MONTH_NAMES[0]` is "Ocak". */
|
|
103
|
+
declare const MONTH_NAMES: readonly string[];
|
|
104
|
+
|
|
105
|
+
/** Returns the storage form of a valid Turkish IBAN (upper case, no spaces), or `null`. */
|
|
106
|
+
declare const normalizeIban: (value: string) => string | null;
|
|
107
|
+
|
|
108
|
+
/** Returns a Turkish phone number in E.164 form ("+905321234567"), or `null`. */
|
|
109
|
+
declare const normalizePhone: (value: string) => string | null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Reads a "dd.MM.yyyy" date into the ISO calendar date "yyyy-MM-dd", or returns `null` when
|
|
113
|
+
* the text is not a date or names a day that does not exist (31.02.2026).
|
|
114
|
+
*/
|
|
115
|
+
declare const parseDate: (text: string) => string | null;
|
|
116
|
+
|
|
117
|
+
/** Reads a Turkish-formatted amount into whole kuruş: "3.490,50" → 349050, or `null`. */
|
|
118
|
+
declare const parseMoney: (text: string) => number | null;
|
|
119
|
+
|
|
120
|
+
/** The 81 provinces of Turkey in plate-code order: `PROVINCES[0]` is Adana, code 1. */
|
|
121
|
+
declare const PROVINCES: readonly Province[];
|
|
122
|
+
|
|
123
|
+
/** Builds a URL and file name safe slug: "Şırnak İl Özel İdaresi" → "sirnak-il-ozel-idaresi". */
|
|
124
|
+
declare const slugify: (text: string) => string;
|
|
125
|
+
|
|
126
|
+
/** Lower-cases text by the Turkish rule: "I" becomes "ı" and "İ" becomes "i". */
|
|
127
|
+
declare const toLowerCase: (text: string) => string;
|
|
128
|
+
|
|
129
|
+
/** Writes every word with a Turkish upper-case first letter and lower-case rest. */
|
|
130
|
+
declare const toTitleCase: (text: string) => string;
|
|
131
|
+
|
|
132
|
+
/** Upper-cases text by the Turkish rule: "i" becomes "İ" and "ı" becomes "I". */
|
|
133
|
+
declare const toUpperCase: (text: string) => string;
|
|
134
|
+
|
|
135
|
+
export { DAY_NAMES, MONTH_NAMES, PROVINCES, capitalize, compareTurkish, foldText, formatDate, formatDateTime, formatIban, formatMoney, formatPhone, getDayName, getMonthName, getPhoneType, getProvinceByCode, getProvinceByName, isValidIban, isValidLicensePlate, isValidPhone, isValidTckn, isValidVkn, moneyToWords, normalizeIban, normalizePhone, parseDate, parseMoney, slugify, toLowerCase, toTitleCase, toUpperCase };
|
|
136
|
+
export type { FormatMoneyOptions, FormatPhoneOptions, PhoneType, Province, TimeZoneOptions };
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/** Upper-cases the first letter by the Turkish rule and leaves the rest as written. */
|
|
2
|
+
declare const capitalize: (text: string) => string;
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Compares two texts in Turkish alphabetical order ("ç" after "c", "ı" before "i") for
|
|
6
|
+
* `Array.prototype.sort`; case and accents only break ties, lower case first.
|
|
7
|
+
*/
|
|
8
|
+
declare const compareTurkish: (left: string, right: string) => number;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Turkish day names, Monday first as on a Turkish calendar: `DAY_NAMES[0]` is "Pazartesi".
|
|
12
|
+
* This is not the order of `Date.prototype.getDay`, where 0 is Sunday.
|
|
13
|
+
*/
|
|
14
|
+
declare const DAY_NAMES: readonly string[];
|
|
15
|
+
|
|
16
|
+
/** Folds text to a search key: Turkish lower case, then "ç ğ ı ö ş ü" and accents to plain letters. */
|
|
17
|
+
declare const foldText: (text: string) => string;
|
|
18
|
+
|
|
19
|
+
/** One of the 81 provinces of Turkey. */
|
|
20
|
+
type Province = {
|
|
21
|
+
/** Licence plate code, 1 to 81. */
|
|
22
|
+
readonly code: number;
|
|
23
|
+
/** Official name in Turkish spelling, such as "İstanbul". */
|
|
24
|
+
readonly name: string;
|
|
25
|
+
};
|
|
26
|
+
/** What a Turkish phone number is, decided by the first digit of its national number. */
|
|
27
|
+
type PhoneType = "mobile" | "landline" | "nonGeographic";
|
|
28
|
+
/** Option shared by every function that reads a calendar date off an instant. */
|
|
29
|
+
type TimeZoneOptions = {
|
|
30
|
+
/** IANA time zone the instant is read in. Defaults to "Europe/Istanbul". */
|
|
31
|
+
timeZone?: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Writes a date as "dd.MM.yyyy". A `Date` or a timestamp is read in `timeZone`; a
|
|
36
|
+
* "yyyy-MM-dd" string is a calendar date already and is written as it stands.
|
|
37
|
+
*/
|
|
38
|
+
declare const formatDate: (date: Date | number | string, { timeZone }?: TimeZoneOptions) => string;
|
|
39
|
+
|
|
40
|
+
/** Writes an instant as "dd.MM.yyyy HH:mm" on the 24-hour clock of `timeZone`. */
|
|
41
|
+
declare const formatDateTime: (date: Date | number, { timeZone }?: TimeZoneOptions) => string;
|
|
42
|
+
|
|
43
|
+
/** Returns a valid Turkish IBAN in printed groups of four ("TR33 0006 1005 …"), or `null`. */
|
|
44
|
+
declare const formatIban: (value: string) => string | null;
|
|
45
|
+
|
|
46
|
+
type FormatMoneyOptions = {
|
|
47
|
+
/** Write the lira sign before the amount ("₺3.490,00") instead of "TL" after it. Defaults to `false`. */
|
|
48
|
+
symbol?: boolean;
|
|
49
|
+
};
|
|
50
|
+
/** Writes an amount held in whole kuruş as Turkish lira: 349000 → "3.490,00 TL". */
|
|
51
|
+
declare const formatMoney: (kurus: number, { symbol }?: FormatMoneyOptions) => string;
|
|
52
|
+
|
|
53
|
+
type FormatPhoneOptions = {
|
|
54
|
+
/** "national" writes "0 (532) 123 45 67", "international" writes "+90 532 123 45 67". Defaults to "national". */
|
|
55
|
+
style?: "national" | "international";
|
|
56
|
+
};
|
|
57
|
+
/** Returns a Turkish phone number in its printed form, or `null`. */
|
|
58
|
+
declare const formatPhone: (value: string, { style }?: FormatPhoneOptions) => string | null;
|
|
59
|
+
|
|
60
|
+
/** Returns the Turkish name of the day of the week a date falls on, such as "Salı". */
|
|
61
|
+
declare const getDayName: (date: Date | number | string, { timeZone }?: TimeZoneOptions) => string;
|
|
62
|
+
|
|
63
|
+
/** Returns the Turkish name of the month a date falls in, such as "Kasım". */
|
|
64
|
+
declare const getMonthName: (date: Date | number | string, { timeZone }?: TimeZoneOptions) => string;
|
|
65
|
+
|
|
66
|
+
/** Tells a mobile number (5XX) from a landline (2XX to 4XX) and a service number (8XX), or returns `null`. */
|
|
67
|
+
declare const getPhoneType: (value: string) => PhoneType | null;
|
|
68
|
+
|
|
69
|
+
/** Finds a province by its plate code, given as a number (6) or as text ("06"), or returns `null`. */
|
|
70
|
+
declare const getProvinceByCode: (code: number | string) => Province | null;
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Finds a province by name without regard to case or Turkish letters ("istanbul", "ISTANBUL"
|
|
74
|
+
* and "İstanbul" all match), or returns `null`.
|
|
75
|
+
*/
|
|
76
|
+
declare const getProvinceByName: (name: string) => Province | null;
|
|
77
|
+
|
|
78
|
+
/** Checks a Turkish IBAN: "TR", 24 digits and the ISO 13616 mod-97 checksum. */
|
|
79
|
+
declare const isValidIban: (value: unknown) => boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Checks that a value has the shape of a civil Turkish licence plate ("34 ABC 123"). Only
|
|
83
|
+
* the shape is checked: whether the plate was ever issued is not something a format can tell.
|
|
84
|
+
*/
|
|
85
|
+
declare const isValidLicensePlate: (value: unknown) => boolean;
|
|
86
|
+
|
|
87
|
+
/** Checks that a value is a Turkish mobile, landline or 8XX service number. */
|
|
88
|
+
declare const isValidPhone: (value: unknown) => boolean;
|
|
89
|
+
|
|
90
|
+
/** Checks the two check digits of a T.C. identity number (11 digits, the first not 0). */
|
|
91
|
+
declare const isValidTckn: (value: unknown) => boolean;
|
|
92
|
+
|
|
93
|
+
/** Checks the check digit of a tax identification number (VKN, 10 digits). */
|
|
94
|
+
declare const isValidVkn: (value: unknown) => boolean;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Writes an amount held in whole kuruş in Turkish words, the way an invoice spells it:
|
|
98
|
+
* 349050 → "üç bin dört yüz doksan Türk lirası elli kuruş".
|
|
99
|
+
*/
|
|
100
|
+
declare const moneyToWords: (kurus: number) => string;
|
|
101
|
+
|
|
102
|
+
/** Turkish month names, January first: `MONTH_NAMES[0]` is "Ocak". */
|
|
103
|
+
declare const MONTH_NAMES: readonly string[];
|
|
104
|
+
|
|
105
|
+
/** Returns the storage form of a valid Turkish IBAN (upper case, no spaces), or `null`. */
|
|
106
|
+
declare const normalizeIban: (value: string) => string | null;
|
|
107
|
+
|
|
108
|
+
/** Returns a Turkish phone number in E.164 form ("+905321234567"), or `null`. */
|
|
109
|
+
declare const normalizePhone: (value: string) => string | null;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Reads a "dd.MM.yyyy" date into the ISO calendar date "yyyy-MM-dd", or returns `null` when
|
|
113
|
+
* the text is not a date or names a day that does not exist (31.02.2026).
|
|
114
|
+
*/
|
|
115
|
+
declare const parseDate: (text: string) => string | null;
|
|
116
|
+
|
|
117
|
+
/** Reads a Turkish-formatted amount into whole kuruş: "3.490,50" → 349050, or `null`. */
|
|
118
|
+
declare const parseMoney: (text: string) => number | null;
|
|
119
|
+
|
|
120
|
+
/** The 81 provinces of Turkey in plate-code order: `PROVINCES[0]` is Adana, code 1. */
|
|
121
|
+
declare const PROVINCES: readonly Province[];
|
|
122
|
+
|
|
123
|
+
/** Builds a URL and file name safe slug: "Şırnak İl Özel İdaresi" → "sirnak-il-ozel-idaresi". */
|
|
124
|
+
declare const slugify: (text: string) => string;
|
|
125
|
+
|
|
126
|
+
/** Lower-cases text by the Turkish rule: "I" becomes "ı" and "İ" becomes "i". */
|
|
127
|
+
declare const toLowerCase: (text: string) => string;
|
|
128
|
+
|
|
129
|
+
/** Writes every word with a Turkish upper-case first letter and lower-case rest. */
|
|
130
|
+
declare const toTitleCase: (text: string) => string;
|
|
131
|
+
|
|
132
|
+
/** Upper-cases text by the Turkish rule: "i" becomes "İ" and "ı" becomes "I". */
|
|
133
|
+
declare const toUpperCase: (text: string) => string;
|
|
134
|
+
|
|
135
|
+
export { DAY_NAMES, MONTH_NAMES, PROVINCES, capitalize, compareTurkish, foldText, formatDate, formatDateTime, formatIban, formatMoney, formatPhone, getDayName, getMonthName, getPhoneType, getProvinceByCode, getProvinceByName, isValidIban, isValidLicensePlate, isValidPhone, isValidTckn, isValidVkn, moneyToWords, normalizeIban, normalizePhone, parseDate, parseMoney, slugify, toLowerCase, toTitleCase, toUpperCase };
|
|
136
|
+
export type { FormatMoneyOptions, FormatPhoneOptions, PhoneType, Province, TimeZoneOptions };
|