Skip to content

Commit 8503c5e

Browse files
committed
Update README.md
1 parent 54218ca commit 8503c5e

File tree

4 files changed

+4
-7
lines changed

4 files changed

+4
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ const object = new model({});
9595
object.save(function (err, doc) {
9696
if (err) {
9797
const error = mongooseErrorHandler(err, {
98-
path: {
98+
paths: {
9999
name: { origin: true },
100100
nameX: { origin: true, kind: 'maxlength' },
101101
}
@@ -127,7 +127,7 @@ const object = new model({});
127127
object.save(function (err, doc) {
128128
if (err) {
129129
const error = mongooseErrorHandler(err, {
130-
path: {
130+
paths: {
131131
name: { message: 'name is required' },
132132
nameX: { message: 'name length must be less than or equal to {maxlength} characters long', kind: 'maxlength' },
133133
}

example/sample.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const mongoose = require('mongoose');
2-
const mongooseErrorHandler = require('..');
2+
const mongooseErrorHandler = require('../');
33

44
const schema = new mongoose.Schema({
55
name: {

index.d.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
2-
export = mongooseValidationErrorHandler;
3-
41
type ValidatorMessages = {
52
base: String,
63
required: String,

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
require('./lib');
1+
module.exports = exports = require('./lib');

0 commit comments

Comments
 (0)