@zentered/issue-forms-body-parser 1.3.0 → 1.4.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/package.json DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "type": "module"
3
- }
package/test/issue.json DELETED
@@ -1,6 +0,0 @@
1
- {
2
- "action": "opened",
3
- "issue": {
4
- "body": "### List Item Checked\n\n* [x] I agree to follow this project's\n [Code of Conduct](https://berlincodeofconduct.org)\n"
5
- }
6
- }
@@ -1,109 +0,0 @@
1
- 'use strict'
2
-
3
- import t from 'tap'
4
- import fn from '../src/parse.js'
5
- import { readFile } from 'fs/promises'
6
- import { join } from 'path'
7
-
8
- const test = t.test
9
-
10
- test('parse(md) should parse GitHub Issue Form data into useful, structured data', async (t) => {
11
- const expected = {
12
- 'event-description': {
13
- order: 0,
14
- title: 'Event Description',
15
- text: "Let's meet for coffee and chat about tech, coding, Cyprus and the newly formed\nCDC (Cyprus Developer Community)."
16
- },
17
- location: {
18
- order: 1,
19
- title: 'Location',
20
- text: '[Cafe Nero Finikoudes, Larnaka](https://goo.gl/maps/Bzjxdeat3BSdsUSVA)'
21
- },
22
- date: {
23
- order: 2,
24
- title: 'Date',
25
- text: '11.03.2022',
26
- date: '2022-03-11'
27
- },
28
- time: { order: 3, title: 'Time', text: '16:00', time: '16:00' },
29
- duration: {
30
- order: 4,
31
- title: 'Duration',
32
- text: '2h',
33
- duration: { hours: 2, minutes: 0 }
34
- },
35
- 'list-item-checked': {
36
- order: 5,
37
- title: 'List Item Checked',
38
- list: [
39
- {
40
- checked: true,
41
- text: "I agree to follow this project's\nCode of Conduct"
42
- }
43
- ],
44
- text: "* [x] I agree to follow this project's\n [Code of Conduct](https://berlincodeofconduct.org)"
45
- },
46
- 'list-item-unchecked': {
47
- order: 6,
48
- title: 'List Item Unchecked',
49
- list: [
50
- {
51
- checked: false,
52
- text: "I agree to follow this project's\nCode of Conduct"
53
- }
54
- ],
55
- text: "* [ ] I agree to follow this project's\n [Code of Conduct](https://berlincodeofconduct.org)"
56
- },
57
- 'mixed-task-list': {
58
- order: 7,
59
- title: 'Mixed Task List',
60
- list: [
61
- { checked: true, text: 'checked' },
62
- { checked: false, text: 'unchecked' },
63
- { checked: true, text: 'checked 2' },
64
- { checked: true, text: 'checked 3' },
65
- { checked: false, text: 'unchecked 2' }
66
- ],
67
- text: '* [x] checked\n* [ ] unchecked\n* [x] checked 2\n* [x] checked 3\n* [ ] unchecked 2'
68
- },
69
- 'complex-list': {
70
- order: 8,
71
- title: 'Complex List',
72
- list: [
73
- { checked: null, text: 'one' },
74
- { checked: null, text: 'two' }
75
- ],
76
- text: '* one\n* two\n * three\n * four\n 1. five\n 2. six'
77
- },
78
- repositories: {
79
- order: 9,
80
- title: 'Repositories',
81
- text: '```csv\nhttps://example.com/repository-1\nhttps://example.com/repository-2\n```'
82
- },
83
- visibility: {
84
- order: 10,
85
- title: 'Visibility',
86
- text: 'Internal'
87
- }
88
- }
89
-
90
- const md = await readFile(
91
- join(process.cwd(), 'test', 'test-issue-1.md'),
92
- 'utf8'
93
- )
94
- const actual = await fn(md)
95
- // console.log(JSON.stringify(actual, null, 0))
96
- t.deepEqual(actual, expected)
97
- })
98
-
99
- test('parse(md) return nothing', async (t) => {
100
- const expected = {}
101
-
102
- const md = await readFile(
103
- join(process.cwd(), 'test', 'test-issue-2.md'),
104
- 'utf8'
105
- )
106
- const actual = await fn(md)
107
- // console.log(JSON.stringify(actual, null, 0))
108
- t.deepEqual(actual, expected)
109
- })
@@ -1,58 +0,0 @@
1
- ### Event Description
2
-
3
- Let's meet for coffee and chat about tech, coding, Cyprus and the newly formed
4
- CDC (Cyprus Developer Community).
5
-
6
- ### Location
7
-
8
- [Cafe Nero Finikoudes, Larnaka](https://goo.gl/maps/Bzjxdeat3BSdsUSVA)
9
-
10
- ### Date
11
-
12
- 11.03.2022
13
-
14
- ### Time
15
-
16
- 16:00
17
-
18
- ### Duration
19
-
20
- 2h
21
-
22
- ### List Item Checked
23
-
24
- - [x] I agree to follow this project's
25
- [Code of Conduct](https://berlincodeofconduct.org)
26
-
27
- ### List Item Unchecked
28
-
29
- - [ ] I agree to follow this project's
30
- [Code of Conduct](https://berlincodeofconduct.org)
31
-
32
- ### Mixed Task List
33
-
34
- - [x] checked
35
- - [ ] unchecked
36
- - [x] checked 2
37
- - [x] checked 3
38
- - [ ] unchecked 2
39
-
40
- ### Complex List
41
-
42
- - one
43
- - two
44
- - three
45
- - four
46
- 1. five
47
- 2. six
48
-
49
- ### Repositories
50
-
51
- ```csv
52
- https://example.com/repository-1
53
- https://example.com/repository-2
54
- ```
55
-
56
- ### Visibility
57
-
58
- Internal
@@ -1,10 +0,0 @@
1
- ---
2
- startDate: 10.03.2022
3
- startTime: 10.00
4
- duration: 1h
5
- location: online
6
- ---
7
-
8
- Let's chat about tech, coding and Cyprus.
9
-
10
- https://discord.gg/qA7wHjbs?event=948887583507755048