const mongoose = require('mongoose');

const isValidMongooseId = (id) => {
    const isValidId = mongoose.Types.ObjectId.isValid(id);
    if (!isValidId) {
        throw new Error('Invalid ID');
    }
    return true;
};

module.exports = isValidMongooseId;
