Skip to content

Commit

Permalink
fix: improve warning message re: #10414
Browse files Browse the repository at this point in the history
  • Loading branch information
vkarpov15 committed Aug 23, 2021
1 parent 6002177 commit a2b76a1
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/schema.js
Expand Up @@ -634,12 +634,9 @@ Schema.prototype.path = function(path, obj) {
// some path names conflict with document methods
const firstPieceOfPath = path.split('.')[0];
if (reserved[firstPieceOfPath] && !this.options.supressReservedKeysWarning) {
const errorMessage = `
\`${firstPieceOfPath}\` is a reserved schema pathname and may break some functionality.
You are allowed to use it, but use at your own risk.
To disable this warning pass \`supressReservedKeysWarning\` as a schema option.
Learn more: <LINK_TO_DOCS_HERE>
`;
const errorMessage = `\`${firstPieceOfPath}\` is a reserved schema pathname and may break some functionality. ` +
'You are allowed to use it, but use at your own risk. ' +
'To disable this warning pass `supressReservedKeysWarning` as a schema option.';

console.warn(errorMessage);
}
Expand Down

0 comments on commit a2b76a1

Please sign in to comment.