Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(schematype): actually always return "this" where specified #12141

Merged
merged 1 commit into from Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/schematype.js
Expand Up @@ -462,7 +462,7 @@ SchemaType.prototype.unique = function(bool) {
SchemaType.prototype.text = function(bool) {
if (this._index === false) {
if (!bool) {
return;
return this;
}
throw new Error('Path "' + this.path + '" may not have `index` set to ' +
'false and `text` set to true');
Expand Down Expand Up @@ -499,7 +499,7 @@ SchemaType.prototype.text = function(bool) {
SchemaType.prototype.sparse = function(bool) {
if (this._index === false) {
if (!bool) {
return;
return this;
}
throw new Error('Path "' + this.path + '" may not have `index` set to ' +
'false and `sparse` set to true');
Expand Down