jd-intel 0.3.1 → 0.3.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jd-intel",
3
- "version": "0.3.1",
3
+ "version": "0.3.2",
4
4
  "description": "Fetch and normalize job descriptions across every major ATS (Greenhouse, Lever, Ashby) — for your AI assistant, no copy-paste.",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/normalizer.js CHANGED
@@ -3,8 +3,11 @@ import { createHash } from 'node:crypto';
3
3
  /**
4
4
  * Generate a stable ID for a job posting.
5
5
  */
6
- export function jobId(company, title, ats) {
7
- const raw = `${company}|${title}|${ats}`.toLowerCase().trim();
6
+ export function jobId(company, title, ats, location = '') {
7
+ // Location is part of identity: the same role posted in multiple
8
+ // offices is distinct requisitions with distinct URLs. Omitting it
9
+ // collapsed multi-office postings to one id (see issue #17).
10
+ const raw = `${company}|${title}|${ats}|${location}`.toLowerCase().trim();
8
11
  return createHash('md5').update(raw).digest('hex').substring(0, 12);
9
12
  }
10
13
 
@@ -14,7 +17,7 @@ export function jobId(company, title, ats) {
14
17
  export function normalize(raw, ats) {
15
18
  const now = new Date().toISOString();
16
19
  return {
17
- id: jobId(raw.company || raw.companySlug, raw.title, ats),
20
+ id: jobId(raw.company || raw.companySlug, raw.title, ats, raw.location || ''),
18
21
  company: raw.company || raw.companySlug || '',
19
22
  companySlug: raw.companySlug || '',
20
23
  ats,