@thejob/util 1.0.26 → 1.0.27
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/cjs/user/utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrC,GAAG,MAAM,CAkDT;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;WAAvB,MAAM;WAAS,MAAM;CAWtE,CAAC"}
|
package/dist/cjs/user/utils.js
CHANGED
|
@@ -12,32 +12,32 @@ exports.prepareUserForEmbedding = prepareUserForEmbedding;
|
|
|
12
12
|
* 3. Flattened structured data (skills, experience, education)
|
|
13
13
|
*/
|
|
14
14
|
function prepareUserForEmbedding(user) {
|
|
15
|
-
const headline = user.headline?.trim() ||
|
|
16
|
-
const about = user.aboutMe?.replace(/\n/g,
|
|
15
|
+
const headline = user.headline?.trim() || "";
|
|
16
|
+
const about = user.aboutMe?.replace(/\n/g, " ").trim() || "";
|
|
17
17
|
const locationParts = [
|
|
18
18
|
user.location?.city,
|
|
19
19
|
user.location?.stateCode || user.location?.state,
|
|
20
20
|
user.location?.country,
|
|
21
21
|
].filter(Boolean);
|
|
22
|
-
const location = locationParts.join(
|
|
22
|
+
const location = locationParts.join(", ");
|
|
23
23
|
const skillsList = user.skills
|
|
24
|
-
?.map((s) => s.name.toLowerCase())
|
|
24
|
+
?.map((s) => (s.skill?.name ?? s.name)?.toLowerCase())
|
|
25
25
|
.filter(Boolean)
|
|
26
|
-
.join(
|
|
26
|
+
.join(", ") || "";
|
|
27
27
|
const experienceList = user.workExperiences
|
|
28
|
-
?.map((w) => [w.title, w.company].filter(Boolean).join(
|
|
28
|
+
?.map((w) => [w.title, w.company].filter(Boolean).join(" at "))
|
|
29
29
|
.filter(Boolean)
|
|
30
|
-
.join(
|
|
30
|
+
.join("; ") || "";
|
|
31
31
|
const educationList = user.educations
|
|
32
|
-
?.map((e) => [e.degree, e.fieldOfStudy, e.institution ? `at ${e.institution}` :
|
|
32
|
+
?.map((e) => [e.degree, e.fieldOfStudy, e.institution ? `at ${e.institution}` : ""]
|
|
33
33
|
.filter(Boolean)
|
|
34
|
-
.join(
|
|
34
|
+
.join(" "))
|
|
35
35
|
.filter(Boolean)
|
|
36
|
-
.join(
|
|
36
|
+
.join("; ") || "";
|
|
37
37
|
const languagesList = user.languages
|
|
38
38
|
?.map((l) => l.name)
|
|
39
39
|
.filter(Boolean)
|
|
40
|
-
.join(
|
|
40
|
+
.join(", ") || "";
|
|
41
41
|
const parts = [];
|
|
42
42
|
if (headline)
|
|
43
43
|
parts.push(`Headline: ${headline}`);
|
|
@@ -55,7 +55,7 @@ function prepareUserForEmbedding(user) {
|
|
|
55
55
|
parts.push(`Education: ${educationList}`);
|
|
56
56
|
if (languagesList)
|
|
57
57
|
parts.push(`Languages: ${languagesList}`);
|
|
58
|
-
return parts.join(
|
|
58
|
+
return parts.join(". ").replace(/\s\s+/g, " ").trim();
|
|
59
59
|
}
|
|
60
60
|
const parseName = (name) => {
|
|
61
61
|
if (typeof name === "string") {
|
package/dist/esm/user/utils.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/user/utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE;QACT,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,MAAM,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,CAAC,EAAE,KAAK,CAAC;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,UAAU,CAAC,EAAE,KAAK,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC,CAAC;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACrC,GAAG,MAAM,CAkDT;AAED,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,GAAG;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE;WAAvB,MAAM;WAAS,MAAM;CAWtE,CAAC"}
|
package/dist/esm/user/utils.js
CHANGED
|
@@ -8,32 +8,32 @@
|
|
|
8
8
|
* 3. Flattened structured data (skills, experience, education)
|
|
9
9
|
*/
|
|
10
10
|
export function prepareUserForEmbedding(user) {
|
|
11
|
-
const headline = user.headline?.trim() ||
|
|
12
|
-
const about = user.aboutMe?.replace(/\n/g,
|
|
11
|
+
const headline = user.headline?.trim() || "";
|
|
12
|
+
const about = user.aboutMe?.replace(/\n/g, " ").trim() || "";
|
|
13
13
|
const locationParts = [
|
|
14
14
|
user.location?.city,
|
|
15
15
|
user.location?.stateCode || user.location?.state,
|
|
16
16
|
user.location?.country,
|
|
17
17
|
].filter(Boolean);
|
|
18
|
-
const location = locationParts.join(
|
|
18
|
+
const location = locationParts.join(", ");
|
|
19
19
|
const skillsList = user.skills
|
|
20
|
-
?.map((s) => s.name.toLowerCase())
|
|
20
|
+
?.map((s) => (s.skill?.name ?? s.name)?.toLowerCase())
|
|
21
21
|
.filter(Boolean)
|
|
22
|
-
.join(
|
|
22
|
+
.join(", ") || "";
|
|
23
23
|
const experienceList = user.workExperiences
|
|
24
|
-
?.map((w) => [w.title, w.company].filter(Boolean).join(
|
|
24
|
+
?.map((w) => [w.title, w.company].filter(Boolean).join(" at "))
|
|
25
25
|
.filter(Boolean)
|
|
26
|
-
.join(
|
|
26
|
+
.join("; ") || "";
|
|
27
27
|
const educationList = user.educations
|
|
28
|
-
?.map((e) => [e.degree, e.fieldOfStudy, e.institution ? `at ${e.institution}` :
|
|
28
|
+
?.map((e) => [e.degree, e.fieldOfStudy, e.institution ? `at ${e.institution}` : ""]
|
|
29
29
|
.filter(Boolean)
|
|
30
|
-
.join(
|
|
30
|
+
.join(" "))
|
|
31
31
|
.filter(Boolean)
|
|
32
|
-
.join(
|
|
32
|
+
.join("; ") || "";
|
|
33
33
|
const languagesList = user.languages
|
|
34
34
|
?.map((l) => l.name)
|
|
35
35
|
.filter(Boolean)
|
|
36
|
-
.join(
|
|
36
|
+
.join(", ") || "";
|
|
37
37
|
const parts = [];
|
|
38
38
|
if (headline)
|
|
39
39
|
parts.push(`Headline: ${headline}`);
|
|
@@ -51,7 +51,7 @@ export function prepareUserForEmbedding(user) {
|
|
|
51
51
|
parts.push(`Education: ${educationList}`);
|
|
52
52
|
if (languagesList)
|
|
53
53
|
parts.push(`Languages: ${languagesList}`);
|
|
54
|
-
return parts.join(
|
|
54
|
+
return parts.join(". ").replace(/\s\s+/g, " ").trim();
|
|
55
55
|
}
|
|
56
56
|
export const parseName = (name) => {
|
|
57
57
|
if (typeof name === "string") {
|