@trayio/connector-utils
Advanced tools
Comparing version 0.3.4 to 0.3.5
@@ -25,3 +25,3 @@ /* eslint-disable no-console */ | ||
})), | ||
['key', 'type', 'description', 'full stop'], | ||
['key', 'type', 'description', 'ending punctuation'], | ||
); | ||
@@ -90,2 +90,9 @@ }; | ||
// check if description ends in valid punctuation | ||
const hasValidEndingPunctuation = description => { | ||
const validPunctuation = ['.', '?', '!'] | ||
const endingChar = description.slice(-1) | ||
return validPunctuation.includes(endingChar) | ||
} | ||
// Schema elements must include 'type' and 'description' keys. | ||
@@ -101,4 +108,4 @@ const checkForIncompleteSchemaElements = ({ element, key }) => { | ||
incompleteSchemaElements.push({ key, missing: 'description' }); | ||
} else if (!_.get(element, 'description', '.').endsWith('.')) { | ||
incompleteSchemaElements.push({ key, missing: 'full stop' }); | ||
} else if (!hasValidEndingPunctuation(_.get(element, 'description', '.'))) { | ||
incompleteSchemaElements.push({ key, missing: 'ending punctuation' }); | ||
} | ||
@@ -105,0 +112,0 @@ } |
{ | ||
"name": "@trayio/connector-utils", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Common utility functions used in connectors.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -432,5 +432,5 @@ # Connector-utils | ||
- `type` or `description` keys are missing, or | ||
- a `description` does not end in a full stop | ||
- a `description` does not end with valid punctuation | ||
Will not log to the console if requested key does not exist, but is overridden with at least a type and description with a full stop. | ||
Will not log to the console if requested key does not exist, but is overridden with at least a type and description ending with a valid punctuation mark. | ||
@@ -437,0 +437,0 @@ For more information on how to use the schema generator, please see [schema-generation.md](./schema-generation.md). |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
55573
847
0