@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
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this package are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and the package follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [Unreleased]
|
|
9
|
+
|
|
10
|
+
## [1.0.0] - 2026-11-10
|
|
11
|
+
|
|
12
|
+
First public release.
|
|
13
|
+
|
|
14
|
+
### Added
|
|
15
|
+
|
|
16
|
+
- **Text:** `toUpperCase`, `toLowerCase`, `capitalize` and `toTitleCase` with
|
|
17
|
+
the Turkish rule for "i" and "ı", independent of the locale data of the
|
|
18
|
+
runtime; `compareTurkish`, a comparator for `Array.prototype.sort` in Turkish
|
|
19
|
+
alphabetical order; `foldText`, a key for case-insensitive and
|
|
20
|
+
accent-insensitive search; `slugify`.
|
|
21
|
+
- **Identity and bank numbers:** `isValidTckn` (T.C. identity number),
|
|
22
|
+
`isValidVkn` (tax identification number) and `isValidIban` (Turkish IBAN,
|
|
23
|
+
ISO 13616 checksum); `normalizeIban` for storage and `formatIban` for
|
|
24
|
+
reading.
|
|
25
|
+
- **Phone numbers:** `isValidPhone`, `getPhoneType` (`"mobile"`, `"landline"`
|
|
26
|
+
or `"nonGeographic"`), `normalizePhone` (E.164) and `formatPhone` with a
|
|
27
|
+
national and an international style.
|
|
28
|
+
- **Money:** `formatMoney` (whole kuruş to `3.490,50 TL` or `₺3.490,50`,
|
|
29
|
+
without `Intl`), `parseMoney` (Turkish notation to whole kuruş) and
|
|
30
|
+
`moneyToWords` (the amount written out in Turkish). No function does
|
|
31
|
+
floating-point arithmetic on an amount.
|
|
32
|
+
- **Dates:** `formatDate` (`dd.MM.yyyy`) and `formatDateTime`
|
|
33
|
+
(`dd.MM.yyyy HH:mm`) with a `timeZone` option that defaults to
|
|
34
|
+
`Europe/Istanbul`; `parseDate`, which reads `dd.MM.yyyy` into an ISO
|
|
35
|
+
`yyyy-MM-dd` string and rejects dates that do not exist; `getMonthName`,
|
|
36
|
+
`getDayName`, `MONTH_NAMES` and `DAY_NAMES`.
|
|
37
|
+
- **Geography:** `PROVINCES` (the 81 provinces with their plate codes),
|
|
38
|
+
`getProvinceByCode`, `getProvinceByName` and `isValidLicensePlate` (the six
|
|
39
|
+
civil plate layouts).
|
|
40
|
+
- **Types:** `FormatMoneyOptions`, `FormatPhoneOptions`, `PhoneType`,
|
|
41
|
+
`Province` and `TimeZoneOptions`.
|
|
42
|
+
- ESM, CommonJS and minified UMD builds with source maps and TypeScript
|
|
43
|
+
declarations; zero runtime dependencies; `"sideEffects": false`.
|
|
44
|
+
|
|
45
|
+
[Unreleased]: https://github.com/handijit/tr/compare/v1.0.0...HEAD
|
|
46
|
+
[1.0.0]: https://github.com/handijit/tr/releases/tag/v1.0.0
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Han Dijit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|