@yamlresume/core 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/dist/index.js CHANGED
@@ -18,7 +18,7 @@ ${N(n.content)}\\end{enumerate}
18
18
  `?"":n.replace(/(^[ \t]*\n)/gm,`%
19
19
  `)}function zn(n){return {...n,content:merge({awards:[],basics:{},certificates:[],education:[],interests:[],languages:[],location:{},profiles:[],projects:[],publications:[],references:[],skills:[],volunteer:[],work:[]},n.content)}}function jn(n){return Object.entries(n.content).forEach(([e,t])=>{if(e==="basics"||e==="location")sn(t);else {if(e==="computed")return;n.content[e].forEach((r,o)=>{sn(t[o]);});}}),n}function Vn(n){Object.entries(n).forEach(([e,t])=>{n[e]=k(t);});}function sn(n){Object.entries(n).forEach(([e,t])=>{if(e!=="summary"){if(e==="computed"){Vn(t);return}if(["courses","keywords"].includes(e)){n[e]=t.map(r=>k(r));return}n[e]=k(t);}});}function Hn(n){let{punctuations:{Separator:e}}=g(n.layout.locale?.language);return n.content.education.forEach((t,r)=>{s(t.courses)||(n.content.education[r].computed={...n.content.education[r].computed,courses:t.courses.join(`${e}
20
20
  `)});}),n}function Un(n){let{punctuations:{Colon:e,Comma:t}}=g(n.layout.locale?.language),{education:r,terms:o}=B(n.layout.locale?.language);return n.content.education.forEach(i=>{let u=l(!s(i.degree),r[i.degree]),c=o.Score;i.computed={...i.computed,degreeAreaAndScore:[u,i.area,l(!s(i.score),`${c}${e}${i.score}`)].filter(m=>!s(m)).join(t)};}),n}function Jn(n){let{punctuations:{Separator:e}}=g(n.layout.locale?.language);for(let t of ["interests","languages","projects","skills","work"])n.content[t].forEach((r,o)=>{isArray(r.keywords)&&r.keywords.length>0?n.content[t][o].computed={...n.content[t][o].computed,keywords:r.keywords.join(`${e}`)}:n.content[t][o].computed={...n.content[t][o].computed,keywords:""};});return n}function Wn(n){for(let e of ["awards","certificates"])n.content[e].forEach((t,r)=>{n.content[e][r].computed={...n.content[e][r].computed,date:f(t.date,n.layout.locale?.language)};});for(let e of ["publications"])n.content[e].forEach((t,r)=>{n.content[e][r].computed={...n.content[e][r].computed,releaseDate:f(t.releaseDate,n.layout.locale?.language)};});for(let e of ["education","projects","volunteer","work"])n.content[e].forEach((t,r)=>{n.content[e][r].computed={...n.content[e][r].computed,startDate:f(t.startDate,n.layout.locale?.language)},n.content[e][r].computed={...n.content[e][r].computed,endDate:f(t.endDate,n.layout.locale?.language)},n.content[e][r].computed={...n.content[e][r].computed,dateRange:en(t.startDate,t.endDate,n.layout.locale?.language)};});return n}function qn(n){for(let e of ["education","projects","volunteer","work"])n.content[e].forEach((t,r)=>{s(t.endDate)&&(n.content[e][r].computed={...n.content[e][r].computed,endDate:"Present"});});return n}function _n(n){let{languages:e,languageFluencies:t}=B(n.layout.locale?.language);return n.content.languages.forEach(r=>{s(r.language)||s(r.fluency)||(r.computed={...r.computed,language:e[r.language],fluency:t[r.fluency]});}),n}function Zn(n){let{punctuations:{Comma:e}}=g(n.layout.locale?.language),{location:t}=B(n.layout.locale?.language);switch(n.layout.locale?.language){case "zh-Hans":case "zh-Hans-HK":case "zh-Hans-TW":{let r=[n.content.location.address,n.content.location.postalCode].filter(u=>!s(u)).join(e),o=[t[n.content.location.country],n.content.location.region].filter(u=>!s(u)).join(e),i=[o,n.content.location.city,r].filter(u=>!s(u)).join(" -- ");n.content.location.computed={...n.content.location.computed,postalCodeAndAddress:r,regionAndCountry:o,fullAddress:i};break}default:{let r=[n.content.location.address].filter(u=>!s(u)).join(e),o=[n.content.location.region,t[n.content.location.country],n.content.location.postalCode].filter(u=>!s(u)).join(e),i=[n.content.location.address,n.content.location.city,o].filter(u=>!s(u)).join(" -- ");n.content.location.computed={...n.content.location.computed,postalCodeAndAddress:r,regionAndCountry:o,fullAddress:i};break}}return n}function Xn(n){let e=s(n.content.basics.url)?"":`{\\small \\faLink}\\ \\href{${n.content.basics.url}}{${n.content.basics.url}}`;return n.content.basics.computed={...n.content.basics.computed,url:e},n}function Yn(n){let e=t=>{switch(t){case "Stack Overflow":return "\\faStackOverflow";case "WeChat":return "\\faWeixin";default:return `\\fa${capitalize(t)}`}};return n.content.profiles.forEach((t,r)=>{n.content.profiles[r].computed={...n.content.profiles[r].computed,url:s(t.username)||s(t.network)?"":`{\\small ${e(t.network)}}\\ \\href{${t.url}}{@${t.username}}`};}),n}function Qn(n){let{skills:e}=B(n.layout.locale?.language);return n.content.skills.forEach(t=>{t.computed={...t.computed,level:l(!s(t.level),e[t.level])};}),n}function na(n){return Xn(n),Yn(n),n.content.computed={...n.content.computed,urls:[n.content.basics.computed.url,...n.content.profiles.map(e=>e.computed.url)].filter(e=>!s(e)).join(` {} {} {} \u2022 {} {} {}
21
- `)},n}function aa(n){let{sections:e}=B(n.layout.locale?.language);return n.content.computed={...n.content.computed,sectionNames:Object.keys(n.content).reduce((t,r)=>(r==="computed"||(t[r]=e[r]),t),{})},n}function ea(n,e){n.content.basics.computed={...n.content.basics.computed,summary:un(new T().generate(e.parse(n.content.basics.summary)).trim())};for(let t of ["awards","education","projects","publications","references","volunteer","work"])n.content[t].forEach((r,o)=>{let i=new T().generate(e.parse(r.summary));i&&(n.content[t][o].computed={...n.content[t][o].computed,summary:un(i.trim())});});return n}function ta(n,e){return [zn,jn,Hn,Un,Wn,qn,Jn,_n,Zn,Qn,na,ea,aa].reduce((t,r)=>r(t,e),n)}function ra(n){if(n.layout.typography.fontSpec?.numbers!==void 0&&n.layout.typography.fontSpec?.numbers!=="Undefined")return n;switch(n.layout.locale?.language){case "zh-Hans":case "zh-Hans-HK":case "zh-Hans-TW":n.layout.typography.fontSpec={...n.layout.typography.fontSpec,numbers:"Lining"};break;default:n.layout.typography.fontSpec={...n.layout.typography.fontSpec,numbers:"OldStyle"};break}return n}function oa(n){return ra(n),{...n,layout:merge(cloneDeep(L),n.layout)}}function q(n,e){return [ta,oa].reduce((t,r)=>r(t,e),cloneDeep(n))}var G=class{resume;constructor(e){this.resume=e;}};function _(n){return ["zh-Hans","zh-Hans-HK","zh-Hans-TW"].includes(n.layout.locale?.language)}function ia(n){return n.layout.locale?.language==="es"}function w(n){return n.replace(/\s+/g,"")}function yn(n,e){let{layout:{typography:{fontSize:t}}}=n;return `\\documentclass[a4paper, serif, ${w(t)}]{${e}}`}function ua(n,e){let{punctuations:{Colon:t}}=g(n.layout.locale?.language);if(!_(n))return "";switch(e){case "banking":return `% renew moderncv command to adapt for CJK colon
21
+ `)},n}function aa(n){let{sections:e}=B(n.layout.locale?.language);return n.content.computed={...n.content.computed,sectionNames:Object.keys(n.content).reduce((t,r)=>(r==="computed"||(t[r]=e[r]),t),{})},n}function ea(n,e){n.content.basics.computed={...n.content.basics.computed,summary:un(new T().generate(e.parse(n.content.basics.summary)).trim())};for(let t of ["awards","education","projects","publications","references","volunteer","work"])n.content[t].forEach((r,o)=>{let i=new T().generate(e.parse(r.summary));i?n.content[t][o].computed={...n.content[t][o].computed,summary:un(i.trim())}:n.content[t][o].computed={...n.content[t][o].computed,summary:""};});return n}function ta(n,e){return [zn,jn,Hn,Un,Wn,qn,Jn,_n,Zn,Qn,na,ea,aa].reduce((t,r)=>r(t,e),n)}function ra(n){if(n.layout.typography.fontSpec?.numbers!==void 0&&n.layout.typography.fontSpec?.numbers!=="Undefined")return n;switch(n.layout.locale?.language){case "zh-Hans":case "zh-Hans-HK":case "zh-Hans-TW":n.layout.typography.fontSpec={...n.layout.typography.fontSpec,numbers:"Lining"};break;default:n.layout.typography.fontSpec={...n.layout.typography.fontSpec,numbers:"OldStyle"};break}return n}function oa(n){return ra(n),{...n,layout:merge(cloneDeep(L),n.layout)}}function q(n,e){return [ta,oa].reduce((t,r)=>r(t,e),cloneDeep(n))}var G=class{resume;constructor(e){this.resume=e;}};function _(n){return ["zh-Hans","zh-Hans-HK","zh-Hans-TW"].includes(n.layout.locale?.language)}function ia(n){return n.layout.locale?.language==="es"}function w(n){return n.replace(/\s+/g,"")}function yn(n,e){let{layout:{typography:{fontSize:t}}}=n;return `\\documentclass[a4paper, serif, ${w(t)}]{${e}}`}function ua(n,e){let{punctuations:{Colon:t}}=g(n.layout.locale?.language);if(!_(n))return "";switch(e){case "banking":return `% renew moderncv command to adapt for CJK colon
22
22
  \\renewcommand*{\\cvitem}[3][.25em]{%
23
23
  \\ifstrempty{#2}{}{\\hintstyle{#2}${t}}{#3}%
24
24
  \\par\\addvspace{#1}}