commonform-docx 9.3.0 → 10.0.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/NOTES.md +11 -0
- package/index.js +8 -6
- package/package.json +1 -1
- package/templates/paragraph.js +0 -1
- package/test.log +16 -12
- package/lint.log +0 -4
- package/outdated.log +0 -0
package/NOTES.md
ADDED
package/index.js
CHANGED
|
@@ -25,10 +25,8 @@ function defaultStyles (smart) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
module.exports = (
|
|
29
|
-
|
|
30
|
-
values = [],
|
|
31
|
-
{
|
|
28
|
+
module.exports = (form, values = [], options = {}) => {
|
|
29
|
+
let {
|
|
32
30
|
a4 = false,
|
|
33
31
|
after = '',
|
|
34
32
|
blanks = { text: '[•]', highlight: 'yellow' },
|
|
@@ -45,9 +43,13 @@ module.exports = (
|
|
|
45
43
|
smart,
|
|
46
44
|
styles,
|
|
47
45
|
title,
|
|
48
|
-
version
|
|
46
|
+
version,
|
|
47
|
+
...rest
|
|
48
|
+
} = options
|
|
49
|
+
const extraKeys = Object.keys(rest)
|
|
50
|
+
if (extraKeys.length !== 0) {
|
|
51
|
+
throw new Error(`Unsupported Options: ${extraKeys.join(', ')}`)
|
|
49
52
|
}
|
|
50
|
-
) => {
|
|
51
53
|
styles = styles
|
|
52
54
|
? Object.assign({}, defaultStyles(smart), styles)
|
|
53
55
|
: defaultStyles(smart)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "commonform-docx",
|
|
3
3
|
"description": "render Common Forms in Office Open XML (Microsoft Word .docx format)",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "10.0.0",
|
|
5
5
|
"author": "Kyle E. Mitchell <kyle@kemitchell.com> (http://kemitchell.com)",
|
|
6
6
|
"bin": "bin.js",
|
|
7
7
|
"dependencies": {
|
package/templates/paragraph.js
CHANGED
package/test.log
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
|
|
2
|
-
> commonform-docx@9.
|
|
2
|
+
> commonform-docx@9.3.0 pretest
|
|
3
3
|
> npm run prepublishOnly
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> commonform-docx@9.
|
|
6
|
+
> commonform-docx@9.3.0 prepublishOnly
|
|
7
7
|
> node build/scaffold.js data/scaffold.docx > data/scaffold.json
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
> commonform-docx@9.
|
|
10
|
+
> commonform-docx@9.3.0 test
|
|
11
11
|
> tape test.js
|
|
12
12
|
|
|
13
13
|
TAP version 13
|
|
@@ -75,24 +75,28 @@ ok 44 conspicuous text appears in output
|
|
|
75
75
|
ok 45 no render error
|
|
76
76
|
ok 46 no textract error
|
|
77
77
|
ok 47 title appears in output
|
|
78
|
-
# renders centered titles
|
|
78
|
+
# renders centered titles by default
|
|
79
79
|
ok 48 no render error
|
|
80
80
|
ok 49 no textract error
|
|
81
81
|
ok 50 title appears in output
|
|
82
|
-
#
|
|
82
|
+
# accepts option for left-align title
|
|
83
83
|
ok 51 no render error
|
|
84
84
|
ok 52 no textract error
|
|
85
|
-
ok 53
|
|
86
|
-
# renders
|
|
85
|
+
ok 53 title appears in output
|
|
86
|
+
# renders versions
|
|
87
87
|
ok 54 no render error
|
|
88
88
|
ok 55 no textract error
|
|
89
|
-
ok 56
|
|
89
|
+
ok 56 version appears in output
|
|
90
|
+
# renders hashes
|
|
91
|
+
ok 57 no render error
|
|
92
|
+
ok 58 no textract error
|
|
93
|
+
ok 59 hash symbol appears in output
|
|
90
94
|
# throws for invalid content
|
|
91
|
-
ok
|
|
95
|
+
ok 60 throw an error
|
|
92
96
|
|
|
93
|
-
1..
|
|
94
|
-
# tests
|
|
95
|
-
# pass
|
|
97
|
+
1..60
|
|
98
|
+
# tests 60
|
|
99
|
+
# pass 60
|
|
96
100
|
|
|
97
101
|
# ok
|
|
98
102
|
|
package/lint.log
DELETED
package/outdated.log
DELETED
|
File without changes
|