Skip to content

Commit

Permalink
clean build
Browse files Browse the repository at this point in the history
  • Loading branch information
mjlux committed Mar 6, 2024
1 parent 939efd5 commit dad3055
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 13 deletions.
10 changes: 9 additions & 1 deletion dist/RequestValidator.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use strict";
var MongooseBreadError = require("./MongooseBreadError"),
var mongoose = require("mongoose"),
MongooseBreadError = require("./MongooseBreadError"),
_require = require("mongoose"),
isValidObjectId = _require.isValidObjectId;
function checkRequest(a) {
Expand Down Expand Up @@ -99,6 +100,13 @@ function checkSchema(a) {
});
return b;
},
getSearchableFieldsOfTypeString(b) {
var c = b.filter(function (b) {
var c = a.path(b) instanceof mongoose.Schema.Types.String;
return c || void 0, c;
});
return c;
},
};
return b;
}
Expand Down
28 changes: 16 additions & 12 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ function mongooseBread(a, b) {
),
{},
{ softDeleteOptions: d }
);
),
f = e.searchableFields;
if (
(checkSchema(a).hasMongoosePaginateV2AlreadyInstalled("index.js"),
(f &&
f.length &&
(e.searchableFields = checkSchema(a).getSearchableFieldsOfTypeString(f)),
checkSchema(a).hasMongoosePaginateV2AlreadyInstalled("index.js"),
a.plugin(require("mongoose-paginate-v2")),
(a.statics.browse = browseFactory(e)),
(a.statics.read = readFactory(e)),
Expand All @@ -151,17 +155,17 @@ function mongooseBread(a, b) {
e.softDelete)
) {
checkSchema(a).hasMongooseDeleteAlreadyInstalled("index.js");
var f = e.softDeleteOptions;
if (((f.overrideMethods = !0), f.indexFields)) {
var g = f.deletedBy,
h = f.requestUserIdPath;
f.deletedBy = g && h && "string" == typeof h;
var i = ["deleted"];
f.deletedAt && i.push("deletedAt"),
f.deletedBy && i.push("deletedBy"),
(f.indexFields = i);
var g = e.softDeleteOptions;
if (((g.overrideMethods = !0), g.indexFields)) {
var h = g.deletedBy,
i = g.requestUserIdPath;
g.deletedBy = h && i && "string" == typeof i;
var j = ["deleted"];
g.deletedAt && j.push("deletedAt"),
g.deletedBy && j.push("deletedBy"),
(g.indexFields = j);
}
a.plugin(require("mongoose-delete"), f),
a.plugin(require("mongoose-delete"), g),
(a.statics.softDelete = softDeleteFactory(e)),
(a.statics.rehabilitate = rehabilitateFactory(e));
}
Expand Down

0 comments on commit dad3055

Please sign in to comment.