Skip to content

Commit

Permalink
fix: case where description schemas would throw errors
Browse files Browse the repository at this point in the history
  • Loading branch information
erunion committed May 26, 2023
1 parent 1dbc615 commit 7168e1c
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
* @param {string} input
*/
module.exports = function sentencePunctuation(input) {
if (input.split(' ').length <= 3) {
if (!input) {
// Minor protection for when we have a `description` property as part of an endpoint payload,
// not a `description` of a schema entry.
return [];
} else if (input.split(' ').length <= 3) {
return [];
} else if (!input.match(/^(.*)[.?!/]$/m)) {
return [
Expand Down

0 comments on commit 7168e1c

Please sign in to comment.