@enure/jacklin 3.3.0 → 3.4.0
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/README.md +1 -11
- package/index.ts +37 -2
- package/package.json +4 -4
- package/template.handlebars +1 -0
package/README.md
CHANGED
package/index.ts
CHANGED
|
@@ -3,21 +3,56 @@ import { dirname, resolve } from "path";
|
|
|
3
3
|
import { readFileSync } from "fs";
|
|
4
4
|
import Handlebars from "handlebars";
|
|
5
5
|
|
|
6
|
+
type WorkItem = {
|
|
7
|
+
name: string;
|
|
8
|
+
position: string;
|
|
9
|
+
startDate: string;
|
|
10
|
+
endDate?: string;
|
|
11
|
+
isFeatured?: boolean;
|
|
12
|
+
hide?: boolean;
|
|
13
|
+
summaryItems?: string[];
|
|
14
|
+
highlights?: string[];
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
type Resume = {
|
|
18
|
+
basics: {
|
|
19
|
+
name: string;
|
|
20
|
+
label: string;
|
|
21
|
+
email: string;
|
|
22
|
+
phone: string;
|
|
23
|
+
summary: string;
|
|
24
|
+
location: {
|
|
25
|
+
city: string;
|
|
26
|
+
region: string;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
work: WorkItem[];
|
|
30
|
+
education: {
|
|
31
|
+
institution: string;
|
|
32
|
+
area: string;
|
|
33
|
+
studyType: string;
|
|
34
|
+
}[];
|
|
35
|
+
};
|
|
36
|
+
|
|
6
37
|
Handlebars.registerHelper("or", (a, b) => a || b);
|
|
7
38
|
|
|
8
39
|
Handlebars.registerHelper("getShortDate", (dateStr) => {
|
|
9
40
|
if (typeof dateStr === 'string') {
|
|
10
41
|
const date = new Date(dateStr);
|
|
42
|
+
if (isNaN(date.getTime())) {
|
|
43
|
+
throw new Error(`Invalid date: "${dateStr}"`);
|
|
44
|
+
}
|
|
11
45
|
const year = date.getFullYear();
|
|
12
46
|
const month = date.getMonth() + 1;
|
|
13
|
-
const fullMonth = month.
|
|
47
|
+
const fullMonth = String(month).padStart(2, '0');
|
|
48
|
+
|
|
14
49
|
return `${fullMonth}/${year}`;
|
|
15
50
|
} else {
|
|
16
51
|
return dateStr;
|
|
17
52
|
}
|
|
18
53
|
});
|
|
19
54
|
|
|
20
|
-
export const render = (resume) => {
|
|
55
|
+
export const render = (resume: Resume) => {
|
|
21
56
|
const modulePath = dirname(fileURLToPath(import.meta.url));
|
|
22
57
|
const template = readFileSync(
|
|
23
58
|
resolve(modulePath, "./template.handlebars"),
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enure/jacklin",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "3.4.0",
|
|
4
|
+
"description": "A JSON Resume theme. Renders resume data to HTML with a bundled Handlebars template.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
7
7
|
"exports": {
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"handlebars": "^4.7.8"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@types/bun": "
|
|
26
|
+
"@types/bun": "1.3.9",
|
|
27
27
|
"resumed": "^6.1.0"
|
|
28
28
|
},
|
|
29
|
-
"packageManager": "
|
|
29
|
+
"packageManager": "bun@1.3.9",
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"typescript": "^5"
|
|
32
32
|
}
|