Sindbad~EG File Manager

Current Path : /home/infinitibizsol/.trash/node_modules.3/class-validator/esm2015/decorator/string/
Upload File :
Current File : /home/infinitibizsol/.trash/node_modules.3/class-validator/esm2015/decorator/string/IsMongoId.js

import { buildMessage, ValidateBy } from '../common/ValidateBy';
import isMongoIdValidator from 'validator/lib/isMongoId';
export const IS_MONGO_ID = 'isMongoId';
/**
 * Checks if the string is a valid hex-encoded representation of a MongoDB ObjectId.
 * If given value is not a string, then it returns false.
 */
export function isMongoId(value) {
    return typeof value === 'string' && isMongoIdValidator(value);
}
/**
 * Checks if the string is a valid hex-encoded representation of a MongoDB ObjectId.
 * If given value is not a string, then it returns false.
 */
export function IsMongoId(validationOptions) {
    return ValidateBy({
        name: IS_MONGO_ID,
        validator: {
            validate: (value, args) => isMongoId(value),
            defaultMessage: buildMessage(eachPrefix => eachPrefix + '$property must be a mongodb id', validationOptions),
        },
    }, validationOptions);
}
//# sourceMappingURL=IsMongoId.js.map

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists