-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Description
Problem
It breaks if leaving the body empty:
/home/user/repo/node_modules/word-wrap/index.js:30
var lines = str.match(re) || [];
^
TypeError: str.match is not a function
at module.exports (/home/user/repo/node_modules/word-wrap/index.js:30:19)
at module.exports (/home/user/repo/node_modules/cz-customizable/lib/build-commit.js:82:14)
at Object.message (/home/user/repo/node_modules/cz-customizable/lib/questions.js:191:33)
at /home/user/repo/node_modules/run-async/index.js:49:25
at new Promise (<anonymous>)
at /home/user/repo/node_modules/run-async/index.js:26:19
at Object.exports.fetchAsyncQuestionProperty (/home/user/repo/node_modules/cz-customizable/node_modules/inquirer/lib/utils/utils.js:21:29)
at MergeMapSubscriber.project (/home/user/repo/node_modules/cz-customizable/node_modules/inquirer/lib/ui/prompt.js:70:17)
at MergeMapSubscriber._tryNext (/home/user/repo/node_modules/cz-customizable/node_modules/rxjs/internal/operators/mergeMap.js:67:27)
at MergeMapSubscriber._next (/home/user/repo/node_modules/cz-customizable/node_modules/rxjs/internal/operators/mergeMap.js:57:18)
Example input
cz-customizable standalone version
All lines except first will be wrapped after 100 characters.
? Select the type of change that you're committing: feat: A new feature
?
Denote the SCOPE of this change (optional): accounts
? Write a SHORT, IMPERATIVE tense description of the change:
test
? Provide a LONGER description of the change (optional). Use "|" to break new line:
false
? List any BREAKING CHANGES (optional):
? List any ISSUES CLOSED by this change (optional). E.g.: #31, #34:
What is causing this?
This is because the default value for body is false
, opposed to other left out values, which are empty strings instead. Have a close look at the Example input above and you will notice the false
under body.
This line in build.commit.js
will then break this, because word-wrap
requires the first argument to be a string (and not a boolean):
let body = wrap(answers.body, wrapOptions) || '';
System
Linux Mint 20.3 Cinnamon
Node v.16.16.0
npm v.8.11.0
extrem7, cvzz, BillHu, lavrentevsn, SenaHuang and 6 more
Metadata
Metadata
Assignees
Labels
No labels