Skip to content

Commit

Permalink
style(mongoose): name some more function
Browse files Browse the repository at this point in the history
  • Loading branch information
hasezoey committed Dec 14, 2024
1 parent 1ee9222 commit 319931f
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions lib/mongoose.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ Mongoose.prototype.setDriver = function setDriver(driver) {
* @api public
*/

Mongoose.prototype.set = function(key, value) {
Mongoose.prototype.set = function getsetOptions(key, value) {
const _mongoose = this instanceof Mongoose ? this : mongoose;

if (arguments.length === 1 && typeof key !== 'object') {
Expand Down Expand Up @@ -376,7 +376,7 @@ Mongoose.prototype.get = Mongoose.prototype.set;
* @api public
*/

Mongoose.prototype.createConnection = function(uri, options) {
Mongoose.prototype.createConnection = function createConnection(uri, options) {
const _mongoose = this instanceof Mongoose ? this : mongoose;

const Connection = _mongoose.__driver.Connection;
Expand Down Expand Up @@ -484,7 +484,7 @@ Mongoose.prototype.disconnect = async function disconnect() {
* @api public
*/

Mongoose.prototype.startSession = function() {
Mongoose.prototype.startSession = function startSession() {
const _mongoose = this instanceof Mongoose ? this : mongoose;

return _mongoose.connection.startSession.apply(_mongoose.connection, arguments);
Expand All @@ -498,7 +498,7 @@ Mongoose.prototype.startSession = function() {
* @api public
*/

Mongoose.prototype.pluralize = function(fn) {
Mongoose.prototype.pluralize = function pluralize(fn) {
const _mongoose = this instanceof Mongoose ? this : mongoose;

if (arguments.length > 0) {
Expand Down Expand Up @@ -561,7 +561,7 @@ Mongoose.prototype.pluralize = function(fn) {
* @api public
*/

Mongoose.prototype.model = function(name, schema, collection, options) {
Mongoose.prototype.model = function model(name, schema, collection, options) {
const _mongoose = this instanceof Mongoose ? this : mongoose;

if (typeof schema === 'string') {
Expand Down Expand Up @@ -632,7 +632,7 @@ Mongoose.prototype.model = function(name, schema, collection, options) {
* ignore
*/

Mongoose.prototype._model = function(name, schema, collection, options) {
Mongoose.prototype._model = function _model(name, schema, collection, options) {
const _mongoose = this instanceof Mongoose ? this : mongoose;

let model;
Expand Down Expand Up @@ -707,7 +707,7 @@ Mongoose.prototype._model = function(name, schema, collection, options) {
* @return {Mongoose} this
*/

Mongoose.prototype.deleteModel = function(name) {
Mongoose.prototype.deleteModel = function deleteModel(name) {
const _mongoose = this instanceof Mongoose ? this : mongoose;

_mongoose.connection.deleteModel(name);
Expand All @@ -726,7 +726,7 @@ Mongoose.prototype.deleteModel = function(name) {
* @return {Array}
*/

Mongoose.prototype.modelNames = function() {
Mongoose.prototype.modelNames = function modelNames() {
const _mongoose = this instanceof Mongoose ? this : mongoose;

const names = Object.keys(_mongoose.models);
Expand All @@ -740,7 +740,7 @@ Mongoose.prototype.modelNames = function() {
* @api private
*/

Mongoose.prototype._applyPlugins = function(schema, options) {
Mongoose.prototype._applyPlugins = function _applyPlugins(schema, options) {
const _mongoose = this instanceof Mongoose ? this : mongoose;

options = options || {};
Expand All @@ -763,7 +763,7 @@ Mongoose.prototype._applyPlugins = function(schema, options) {
* @api public
*/

Mongoose.prototype.plugin = function(fn, opts) {
Mongoose.prototype.plugin = function plugin(fn, opts) {
const _mongoose = this instanceof Mongoose ? this : mongoose;

_mongoose.plugins.push([fn, opts]);
Expand Down Expand Up @@ -1073,7 +1073,7 @@ Mongoose.prototype.ObjectId = SchemaTypes.ObjectId;
* @api public
*/

Mongoose.prototype.isValidObjectId = function(v) {
Mongoose.prototype.isValidObjectId = function isValidObjectId(v) {
const _mongoose = this instanceof Mongoose ? this : mongoose;
return _mongoose.Types.ObjectId.isValid(v);
};
Expand Down Expand Up @@ -1105,7 +1105,7 @@ Mongoose.prototype.isValidObjectId = function(v) {
* @api public
*/

Mongoose.prototype.isObjectIdOrHexString = function(v) {
Mongoose.prototype.isObjectIdOrHexString = function isObjectIdOrHexString(v) {
return isBsonType(v, 'ObjectId') || (typeof v === 'string' && objectIdHexRegexp.test(v));
};

Expand All @@ -1117,7 +1117,7 @@ Mongoose.prototype.isObjectIdOrHexString = function(v) {
* @param {Boolean} options.continueOnError `false` by default. If set to `true`, mongoose will not throw an error if one model syncing failed, and will return an object where the keys are the names of the models, and the values are the results/errors for each model.
* @return {Promise} Returns a Promise, when the Promise resolves the value is a list of the dropped indexes.
*/
Mongoose.prototype.syncIndexes = function(options) {
Mongoose.prototype.syncIndexes = function syncIndexes(options) {
const _mongoose = this instanceof Mongoose ? this : mongoose;
return _mongoose.connection.syncIndexes(options);
};
Expand Down

0 comments on commit 319931f

Please sign in to comment.