mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2026-07-24 17:03:55 +10:00
release: v4.1.0
This commit is contained in:
@@ -20,6 +20,11 @@ import { LinkedIn, linkedInSchema } from "./schema";
|
||||
|
||||
export * from "./schema";
|
||||
|
||||
const avoidTooShort = (name: string, len: number) => {
|
||||
if (!name || name.length < len) return "Unknown";
|
||||
return name;
|
||||
};
|
||||
|
||||
export class LinkedInParser implements Parser<JSZip, LinkedIn> {
|
||||
schema: Schema;
|
||||
|
||||
@@ -44,8 +49,7 @@ export class LinkedInParser implements Parser<JSZip, LinkedIn> {
|
||||
for (const key of Object.keys(linkedInSchema.shape)) {
|
||||
if (name.includes(key)) {
|
||||
const content = await file.async("text");
|
||||
const jsonArray = await parseCSV(content);
|
||||
result[key] = jsonArray;
|
||||
result[key] = await parseCSV(content);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -56,11 +60,6 @@ export class LinkedInParser implements Parser<JSZip, LinkedIn> {
|
||||
convert(data: LinkedIn) {
|
||||
const result = JSON.parse(JSON.stringify(defaultResumeData)) as ResumeData;
|
||||
|
||||
const avoidTooShort = (name: string, len: number) => {
|
||||
if (!name || name.length < len) return "Unknown";
|
||||
return name;
|
||||
};
|
||||
|
||||
// Profile
|
||||
if (data.Profile && data.Profile.length > 0) {
|
||||
const profile = data.Profile[0];
|
||||
@@ -94,8 +93,8 @@ export class LinkedInParser implements Parser<JSZip, LinkedIn> {
|
||||
}
|
||||
|
||||
// Positions
|
||||
if (data["Positions"] && data["Positions"].length > 0) {
|
||||
for (const position of data["Positions"]) {
|
||||
if (data.Positions && data.Positions.length > 0) {
|
||||
for (const position of data.Positions) {
|
||||
result.sections.experience.items.push({
|
||||
...defaultExperience,
|
||||
id: createId(),
|
||||
@@ -109,8 +108,8 @@ export class LinkedInParser implements Parser<JSZip, LinkedIn> {
|
||||
}
|
||||
|
||||
// Education
|
||||
if (data["Education"] && data["Education"].length > 0) {
|
||||
for (const education of data["Education"]) {
|
||||
if (data.Education && data.Education.length > 0) {
|
||||
for (const education of data.Education) {
|
||||
result.sections.education.items.push({
|
||||
...defaultEducation,
|
||||
id: createId(),
|
||||
@@ -123,8 +122,8 @@ export class LinkedInParser implements Parser<JSZip, LinkedIn> {
|
||||
}
|
||||
|
||||
// Skills
|
||||
if (data["Skills"] && data["Skills"].length > 0) {
|
||||
for (const skill of data["Skills"]) {
|
||||
if (data.Skills && data.Skills.length > 0) {
|
||||
for (const skill of data.Skills) {
|
||||
result.sections.skills.items.push({
|
||||
...defaultSkill,
|
||||
id: createId(),
|
||||
@@ -134,8 +133,8 @@ export class LinkedInParser implements Parser<JSZip, LinkedIn> {
|
||||
}
|
||||
|
||||
// Languages
|
||||
if (data["Languages"] && data["Languages"].length > 0) {
|
||||
for (const language of data["Languages"]) {
|
||||
if (data.Languages && data.Languages.length > 0) {
|
||||
for (const language of data.Languages) {
|
||||
result.sections.languages.items.push({
|
||||
...defaultLanguage,
|
||||
id: createId(),
|
||||
@@ -146,8 +145,8 @@ export class LinkedInParser implements Parser<JSZip, LinkedIn> {
|
||||
}
|
||||
|
||||
// Certifications
|
||||
if (data["Certifications"] && data["Certifications"].length > 0) {
|
||||
for (const certification of data["Certifications"]) {
|
||||
if (data.Certifications && data.Certifications.length > 0) {
|
||||
for (const certification of data.Certifications) {
|
||||
result.sections.certifications.items.push({
|
||||
...defaultCertification,
|
||||
id: createId(),
|
||||
@@ -160,8 +159,8 @@ export class LinkedInParser implements Parser<JSZip, LinkedIn> {
|
||||
}
|
||||
|
||||
// Projects
|
||||
if (data["Projects"] && data["Projects"].length > 0) {
|
||||
for (const project of data["Projects"]) {
|
||||
if (data.Projects && data.Projects.length > 0) {
|
||||
for (const project of data.Projects) {
|
||||
result.sections.projects.items.push({
|
||||
...defaultProject,
|
||||
id: createId(),
|
||||
|
||||
@@ -3,7 +3,7 @@ import { z } from "zod";
|
||||
export const educationSchema = z.object({
|
||||
"School Name": z.string(),
|
||||
"Start Date": z.string(),
|
||||
"End Date": z.string(),
|
||||
"End Date": z.string().optional(),
|
||||
Notes: z.string().optional(),
|
||||
"Degree Name": z.string(),
|
||||
Activities: z.string(),
|
||||
|
||||
Reference in New Issue
Block a user