commonform-docx 8.0.1 → 8.1.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/bin.js +3 -0
- package/index.js +2 -0
- package/package.json +4 -4
- package/templates/run.js +1 -0
- package/outdated.log +0 -0
package/bin.js
CHANGED
|
@@ -16,6 +16,7 @@ const usage = [
|
|
|
16
16
|
' -H, --hash Render form hash',
|
|
17
17
|
' -a, --a4-paper A4 paper',
|
|
18
18
|
' -b TEXT, --blank-text TEXT Render blanks with custom text',
|
|
19
|
+
' --complete Throw an error if any blank does not have a value.',
|
|
19
20
|
' --component-style STYLE Change component style [default: both]',
|
|
20
21
|
' -d JSON --directions JSON Use directions to fill in blanks',
|
|
21
22
|
' -e VERSION, --form-version VERSION Form version to be rendered',
|
|
@@ -86,6 +87,8 @@ if (parsed['--title']) options.title = parsed['--title']
|
|
|
86
87
|
|
|
87
88
|
if (parsed['--form-version']) options.version = parsed['--form-version']
|
|
88
89
|
|
|
90
|
+
if (parsed['--complete']) options.complete = true
|
|
91
|
+
|
|
89
92
|
if (parsed['--hash']) options.hash = true
|
|
90
93
|
|
|
91
94
|
if (parsed['--a4-paper']) options.a4 = true
|
package/index.js
CHANGED
|
@@ -39,6 +39,7 @@ module.exports = (
|
|
|
39
39
|
leftAlignTitle = false,
|
|
40
40
|
loadedComponentStyle = 'inline',
|
|
41
41
|
markFilled = false,
|
|
42
|
+
complete = false,
|
|
42
43
|
numberStyle = decimalNumbering,
|
|
43
44
|
quoteComponentText = 'Quoting for convenience, with any conflicts resolved in favor of the standard:',
|
|
44
45
|
smart,
|
|
@@ -66,6 +67,7 @@ module.exports = (
|
|
|
66
67
|
leftAlignTitle,
|
|
67
68
|
loadedComponentStyle,
|
|
68
69
|
markFilled,
|
|
70
|
+
complete,
|
|
69
71
|
numberStyle,
|
|
70
72
|
quoteComponentText,
|
|
71
73
|
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": "8.0
|
|
4
|
+
"version": "8.1.0",
|
|
5
5
|
"author": "Kyle E. Mitchell <kyle@kemitchell.com> (http://kemitchell.com)",
|
|
6
6
|
"bin": "bin.js",
|
|
7
7
|
"dependencies": {
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"run-series": "^1.1.8",
|
|
26
26
|
"standard": "^17.0.0",
|
|
27
27
|
"tape": "^5.0.1",
|
|
28
|
-
"textract": "^
|
|
28
|
+
"textract": "^2.5.0"
|
|
29
29
|
},
|
|
30
30
|
"keywords": [
|
|
31
31
|
"Microsoft Office",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"lint": "standard",
|
|
44
44
|
"precoverage": "npm run pretest && istanbul cover -- tape test.js",
|
|
45
45
|
"coverage": "FORCE_COLOR=true istanbul check-coverage coverage/coverage.json",
|
|
46
|
-
"
|
|
47
|
-
"pretest": "npm run
|
|
46
|
+
"prepublishOnly": "node build/scaffold.js data/scaffold.docx > data/scaffold.json",
|
|
47
|
+
"pretest": "npm run prepublishOnly",
|
|
48
48
|
"test": "tape test.js"
|
|
49
49
|
}
|
|
50
50
|
}
|
package/templates/run.js
CHANGED
|
@@ -50,6 +50,7 @@ module.exports = function run (element, conspicuous, options) {
|
|
|
50
50
|
text = element.blank
|
|
51
51
|
if (options.markFilled) Object.assign(properties, styles.filled)
|
|
52
52
|
} else {
|
|
53
|
+
if (options.complete) throw new Error('no value for blank')
|
|
53
54
|
text = options.blanks.text
|
|
54
55
|
if (options.blanks.highlight) Object.assign(properties, styles.highlighted)
|
|
55
56
|
}
|
package/outdated.log
DELETED
|
File without changes
|