@thejob/util 1.0.29 → 1.0.31

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,2 +1,3 @@
1
1
  export * from "./completeness";
2
+ export * from "./job-match-completeness";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/completeness/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/completeness/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC"}
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./completeness"), exports);
18
+ __exportStar(require("./job-match-completeness"), exports);
@@ -0,0 +1,23 @@
1
+ import { TUserSchema } from "@thejob/schema";
2
+ /**
3
+ * Calculates a job-match completeness score (0–100) based only on the fields
4
+ * that directly affect search ranking and candidate-job matching quality.
5
+ *
6
+ * Intentionally excludes profile UX fields (image, mobile, socialAccounts,
7
+ * certifications, projects, interests, additionalInfo) that have no bearing
8
+ * on whether a candidate can be accurately ranked against a job.
9
+ *
10
+ * Weights:
11
+ * skills 35 — directly matched against job requirements
12
+ * workExperiences 30 — actual roles held; strongest role-fit signal
13
+ * experienceLevel 20 — level fit (entry / mid / senior)
14
+ * aboutMe 10 — semantic narrative and intent
15
+ * educations 5 — degree / field matching
16
+ * ---
17
+ * 100
18
+ *
19
+ * Headline is intentionally excluded — it's a weak, noisy signal (personal
20
+ * branding taglines, vague phrases) that doesn't reliably indicate job fit.
21
+ */
22
+ export declare function calculateJobMatchCompleteness(user: Partial<TUserSchema>): number;
23
+ //# sourceMappingURL=job-match-completeness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-match-completeness.d.ts","sourceRoot":"","sources":["../../../src/completeness/job-match-completeness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GACzB,MAAM,CAUR"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.calculateJobMatchCompleteness = calculateJobMatchCompleteness;
4
+ const utils_1 = require("../common/utils");
5
+ /**
6
+ * Calculates a job-match completeness score (0–100) based only on the fields
7
+ * that directly affect search ranking and candidate-job matching quality.
8
+ *
9
+ * Intentionally excludes profile UX fields (image, mobile, socialAccounts,
10
+ * certifications, projects, interests, additionalInfo) that have no bearing
11
+ * on whether a candidate can be accurately ranked against a job.
12
+ *
13
+ * Weights:
14
+ * skills 35 — directly matched against job requirements
15
+ * workExperiences 30 — actual roles held; strongest role-fit signal
16
+ * experienceLevel 20 — level fit (entry / mid / senior)
17
+ * aboutMe 10 — semantic narrative and intent
18
+ * educations 5 — degree / field matching
19
+ * ---
20
+ * 100
21
+ *
22
+ * Headline is intentionally excluded — it's a weak, noisy signal (personal
23
+ * branding taglines, vague phrases) that doesn't reliably indicate job fit.
24
+ */
25
+ function calculateJobMatchCompleteness(user) {
26
+ let score = 0;
27
+ if ((user.skills?.length ?? 0) > 0)
28
+ score += 35;
29
+ if ((user.workExperiences?.length ?? 0) > 0)
30
+ score += 30;
31
+ if (user.experienceLevel)
32
+ score += 20;
33
+ if (user.aboutMe?.trim())
34
+ score += 10;
35
+ if ((user.educations?.length ?? 0) > 0)
36
+ score += 5;
37
+ return (0, utils_1.toPositiveWholeNumber)(score);
38
+ }
@@ -1,2 +1,3 @@
1
1
  export * from "./completeness";
2
+ export * from "./job-match-completeness";
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/completeness/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/completeness/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,0BAA0B,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from "./completeness";
2
+ export * from "./job-match-completeness";
@@ -0,0 +1,23 @@
1
+ import { TUserSchema } from "@thejob/schema";
2
+ /**
3
+ * Calculates a job-match completeness score (0–100) based only on the fields
4
+ * that directly affect search ranking and candidate-job matching quality.
5
+ *
6
+ * Intentionally excludes profile UX fields (image, mobile, socialAccounts,
7
+ * certifications, projects, interests, additionalInfo) that have no bearing
8
+ * on whether a candidate can be accurately ranked against a job.
9
+ *
10
+ * Weights:
11
+ * skills 35 — directly matched against job requirements
12
+ * workExperiences 30 — actual roles held; strongest role-fit signal
13
+ * experienceLevel 20 — level fit (entry / mid / senior)
14
+ * aboutMe 10 — semantic narrative and intent
15
+ * educations 5 — degree / field matching
16
+ * ---
17
+ * 100
18
+ *
19
+ * Headline is intentionally excluded — it's a weak, noisy signal (personal
20
+ * branding taglines, vague phrases) that doesn't reliably indicate job fit.
21
+ */
22
+ export declare function calculateJobMatchCompleteness(user: Partial<TUserSchema>): number;
23
+ //# sourceMappingURL=job-match-completeness.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"job-match-completeness.d.ts","sourceRoot":"","sources":["../../../src/completeness/job-match-completeness.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAG7C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,OAAO,CAAC,WAAW,CAAC,GACzB,MAAM,CAUR"}
@@ -0,0 +1,35 @@
1
+ import { toPositiveWholeNumber } from "../common/utils";
2
+ /**
3
+ * Calculates a job-match completeness score (0–100) based only on the fields
4
+ * that directly affect search ranking and candidate-job matching quality.
5
+ *
6
+ * Intentionally excludes profile UX fields (image, mobile, socialAccounts,
7
+ * certifications, projects, interests, additionalInfo) that have no bearing
8
+ * on whether a candidate can be accurately ranked against a job.
9
+ *
10
+ * Weights:
11
+ * skills 35 — directly matched against job requirements
12
+ * workExperiences 30 — actual roles held; strongest role-fit signal
13
+ * experienceLevel 20 — level fit (entry / mid / senior)
14
+ * aboutMe 10 — semantic narrative and intent
15
+ * educations 5 — degree / field matching
16
+ * ---
17
+ * 100
18
+ *
19
+ * Headline is intentionally excluded — it's a weak, noisy signal (personal
20
+ * branding taglines, vague phrases) that doesn't reliably indicate job fit.
21
+ */
22
+ export function calculateJobMatchCompleteness(user) {
23
+ let score = 0;
24
+ if ((user.skills?.length ?? 0) > 0)
25
+ score += 35;
26
+ if ((user.workExperiences?.length ?? 0) > 0)
27
+ score += 30;
28
+ if (user.experienceLevel)
29
+ score += 20;
30
+ if (user.aboutMe?.trim())
31
+ score += 10;
32
+ if ((user.educations?.length ?? 0) > 0)
33
+ score += 5;
34
+ return toPositiveWholeNumber(score);
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thejob/util",
3
- "version": "1.0.29",
3
+ "version": "1.0.31",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
6
6
  "types": "dist/esm/index.d.ts",