vin-origin-decoder 1.0.4 → 1.0.5

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/dist/index.d.ts CHANGED
@@ -1,2 +1,4 @@
1
- export { decodeVinOrigin } from './decode';
2
- export type { VinOriginResult } from './types';
1
+ import { decodeVinOrigin } from './decode';
2
+ import { WMI_MAP } from './wmi-map';
3
+ import { VIN_REGION_MAP } from './vin-region';
4
+ export { decodeVinOrigin, WMI_MAP, VIN_REGION_MAP };
package/dist/index.js CHANGED
@@ -1,14 +1,4 @@
1
- // export function decodeVinOrigin(vin: string) {
2
- // if (!vin || vin.length < 3) {
3
- // throw new Error('Invalid VIN');
4
- // }
5
- // const wmi = vin.substring(0, 3).toUpperCase();
6
- // const data = WMI_MAP[wmi];
7
- // return {
8
- // vin,
9
- // wmi,
10
- // manufacturer: data?.manufacturer || 'Unknown',
11
- // country: data?.country || 'Unknown',
12
- // };
13
- // }
14
- export { decodeVinOrigin } from './decode';
1
+ import { decodeVinOrigin } from './decode';
2
+ import { WMI_MAP } from './wmi-map';
3
+ import { VIN_REGION_MAP } from './vin-region';
4
+ export { decodeVinOrigin, WMI_MAP, VIN_REGION_MAP };
package/package.json CHANGED
@@ -1,22 +1,23 @@
1
1
  {
2
2
  "name": "vin-origin-decoder",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Decode vehicle origin and manufacturer from VIN",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
- "scripts": {
7
+ "exports": {
8
+ ".": {
9
+ "import": "./dist/index.js",
10
+ "require": "./dist/index.js"
11
+ }
12
+ },
13
+ "scripts": {
8
14
  "build": "tsc"
9
15
  },
10
- "keywords": [
11
- "vin",
12
- "vehicle",
13
- "car",
14
- "decoder",
15
- "origin"
16
- ],
16
+ "keywords": ["vin","vehicle","car","decoder","origin"],
17
17
  "author": "Ngoni Seremwe",
18
18
  "license": "MIT",
19
19
  "devDependencies": {
20
20
  "typescript": "^5.9.3"
21
21
  }
22
22
  }
23
+
package/src/index.ts CHANGED
@@ -1,19 +1,5 @@
1
+ import { decodeVinOrigin } from './decode';
1
2
  import { WMI_MAP } from './wmi-map';
3
+ import { VIN_REGION_MAP } from './vin-region';
2
4
 
3
- // export function decodeVinOrigin(vin: string) {
4
- // if (!vin || vin.length < 3) {
5
- // throw new Error('Invalid VIN');
6
- // }
7
-
8
- // const wmi = vin.substring(0, 3).toUpperCase();
9
- // const data = WMI_MAP[wmi];
10
-
11
- // return {
12
- // vin,
13
- // wmi,
14
- // manufacturer: data?.manufacturer || 'Unknown',
15
- // country: data?.country || 'Unknown',
16
- // };
17
- // }
18
- export { decodeVinOrigin } from './decode';
19
- export type { VinOriginResult } from './types';
5
+ export { decodeVinOrigin, WMI_MAP, VIN_REGION_MAP };
package/tsconfig.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ES2020",
4
- "module": "ESNext",
5
- "declaration": true,
4
+ "module": "ESNext", // For ESM output
5
+ "moduleResolution": "Node",
6
6
  "outDir": "dist",
7
+ "declaration": true, // Generate .d.ts files
8
+ "esModuleInterop": true, // Enables default import interop
9
+ "forceConsistentCasingInFileNames": true,
7
10
  "strict": true,
8
- "moduleResolution": "node",
9
- "esModuleInterop": true
11
+ "skipLibCheck": true
10
12
  },
11
13
  "include": ["src"]
12
14
  }