0.6.6 • Published 6 months ago

@types/mongoose-id-validator v0.6.6

Weekly downloads
138
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/mongoose-id-validator

Summary

This package contains type definitions for mongoose-id-validator (https://github.com/CampbellSoftwareSolutions/mongoose-id-validator).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongoose-id-validator.

index.d.ts

// Type definitions for mongoose-id-validator 0.6
// Project: https://github.com/CampbellSoftwareSolutions/mongoose-id-validator
// Definitions by: Kerollos Magdy <https://github.com/kerolloz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 4.1

import { Schema, Connection } from 'mongoose';

interface MongooseIdValidatorOptions {
    /* Optional, custom validation message with {PATH} being replaced
     * with the relevant schema path that contains an invalid
     * document ID.
     */
    message?: string | undefined;

    /* Optional, mongoose connection object to use if you are
     * using multiple connections in your application.
     *
     * Defaults to built-in mongoose connection if not specified.
     */
    connection?: Connection | undefined;

    /* Optional, applies to validation of arrays of ID references only. Set
     * to true if you sometimes have the same object ID reference
     * repeated in an array. If set, the validator will use the
     * total of unique ID references instead of total number of array
     * entries when checking the database.
     *
     * Defaults to false
     */
    allowDuplicates?: boolean | undefined;
}

declare function mongooseIdValidator(schema: Schema, options?: MongooseIdValidatorOptions): void;

export = mongooseIdValidator;

Additional Details

  • Last updated: Sun, 24 Apr 2022 14:31:47 GMT
  • Dependencies: @types/mongoose
  • Global values: none

Credits

These definitions were written by Kerollos Magdy.

0.6.6

6 months ago

0.6.5

7 months ago

0.6.4

8 months ago

0.6.3

2 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

4 years ago