@code-plate/iran-cities 1.0.0 → 1.0.2

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.
@@ -1,4 +1,5 @@
1
1
  interface City {
2
+ slug: CityKey;
2
3
  /** شناسه انگلیسی/لاتین شهر (kebab-case) - یکتا در سطح کل کشور نیست، در سطح استان یکتاست */
3
4
  en: string;
4
5
  /** نام فارسی شهر */
@@ -17,11 +18,17 @@ interface FlatCity extends City {
17
18
  provinceFa: string;
18
19
  }
19
20
  type Locale = 'en' | 'fa';
21
+ /** کلید پایدار برای ارجاع به یک شهر (همان City.slug) - برای استفاده در پکیج‌های وابسته */
22
+ type CityKey = string;
20
23
  interface SearchOptions {
21
24
  /** تعداد بیشینه نتایج (پیش‌فرض: بدون محدودیت) */
22
25
  limit?: number;
23
26
  /** جستجو فقط در فارسی، فقط در انگلیسی یا هر دو (پیش‌فرض: both) */
24
27
  locale?: Locale | 'both';
28
+ /** فعال‌سازی جستجوی فازی (تحمل غلط تایپی) بر پایه‌ی فاصله‌ی ادیت - پیش‌فرض: false */
29
+ fuzzy?: boolean;
30
+ /** بیشینه فاصله‌ی ادیت مجاز در حالت fuzzy (پیش‌فرض: 2) */
31
+ maxDistance?: number;
25
32
  }
26
33
 
27
- export type { City as C, FlatCity as F, Locale as L, Province as P, SearchOptions as S };
34
+ export type { City as C, FlatCity as F, Locale as L, Province as P, SearchOptions as S, CityKey as a };
@@ -1,4 +1,5 @@
1
1
  interface City {
2
+ slug: CityKey;
2
3
  /** شناسه انگلیسی/لاتین شهر (kebab-case) - یکتا در سطح کل کشور نیست، در سطح استان یکتاست */
3
4
  en: string;
4
5
  /** نام فارسی شهر */
@@ -17,11 +18,17 @@ interface FlatCity extends City {
17
18
  provinceFa: string;
18
19
  }
19
20
  type Locale = 'en' | 'fa';
21
+ /** کلید پایدار برای ارجاع به یک شهر (همان City.slug) - برای استفاده در پکیج‌های وابسته */
22
+ type CityKey = string;
20
23
  interface SearchOptions {
21
24
  /** تعداد بیشینه نتایج (پیش‌فرض: بدون محدودیت) */
22
25
  limit?: number;
23
26
  /** جستجو فقط در فارسی، فقط در انگلیسی یا هر دو (پیش‌فرض: both) */
24
27
  locale?: Locale | 'both';
28
+ /** فعال‌سازی جستجوی فازی (تحمل غلط تایپی) بر پایه‌ی فاصله‌ی ادیت - پیش‌فرض: false */
29
+ fuzzy?: boolean;
30
+ /** بیشینه فاصله‌ی ادیت مجاز در حالت fuzzy (پیش‌فرض: 2) */
31
+ maxDistance?: number;
25
32
  }
26
33
 
27
- export type { City as C, FlatCity as F, Locale as L, Province as P, SearchOptions as S };
34
+ export type { City as C, FlatCity as F, Locale as L, Province as P, SearchOptions as S, CityKey as a };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@code-plate/iran-cities",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "لیست کامل استان‌ها و شهرهای ایران (فارسی/انگلیسی) به‌همراه ابزارهای جستجو - بدون وابستگی، سازگار با هر فریمورک جاوااسکریپتی (React, Next.js, Vue, Angular, Node.js/Express و ...)",
5
5
  "keywords": [
6
6
  "iran",
@@ -9,6 +9,9 @@
9
9
  "استان",
10
10
  "شهر",
11
11
  "ایران",
12
+ "فارسی",
13
+ "پارسی",
14
+ "شهرها و استان‌های ایران",
12
15
  "persian",
13
16
  "farsi",
14
17
  "location",
@@ -16,6 +19,14 @@
16
19
  ],
17
20
  "author": "code-plate",
18
21
  "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/MJavadSF/Iran-Cities.git"
25
+ },
26
+ "homepage": "https://github.com/MJavadSF/Iran-Cities#readme",
27
+ "bugs": {
28
+ "url": "https://github.com/MJavadSF/Iran-Cities/issues"
29
+ },
19
30
  "sideEffects": false,
20
31
  "main": "./dist/index.cjs",
21
32
  "module": "./dist/index.mjs",
@@ -45,8 +56,8 @@
45
56
  }
46
57
  },
47
58
  "devDependencies": {
48
- "@types/react": "^19.2.17",
49
- "react": "^19.2.7",
59
+ "@types/react": "^19.2.18",
60
+ "react": "^19.2.8",
50
61
  "tsup": "^8.5.1",
51
62
  "typescript": "^5.9.3"
52
63
  },
@@ -60,5 +71,8 @@
60
71
  },
61
72
  "publishConfig": {
62
73
  "access": "public"
74
+ },
75
+ "allowScripts": {
76
+ "esbuild@0.27.7": true
63
77
  }
64
78
  }