@kikiutils/mongoose 4.0.1 → 5.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (164) hide show
  1. package/README.md +1 -1
  2. package/dist/_internals.js +6 -0
  3. package/dist/_internals.js.map +1 -0
  4. package/dist/constants.d.ts +7 -2
  5. package/dist/constants.d.ts.map +1 -1
  6. package/dist/constants.js +13 -0
  7. package/dist/constants.js.map +1 -0
  8. package/dist/options.d.ts +8 -4
  9. package/dist/options.d.ts.map +1 -1
  10. package/dist/options.js +17 -0
  11. package/dist/options.js.map +1 -0
  12. package/dist/plugins/normalize.d.ts +20 -16
  13. package/dist/plugins/normalize.d.ts.map +1 -1
  14. package/dist/plugins/normalize.js +47 -0
  15. package/dist/plugins/normalize.js.map +1 -0
  16. package/dist/schema-builders/base.d.ts +6 -3
  17. package/dist/schema-builders/base.d.ts.map +1 -1
  18. package/dist/schema-builders/base.js +34 -0
  19. package/dist/schema-builders/base.js.map +1 -0
  20. package/dist/schema-builders/boolean.d.ts +30 -26
  21. package/dist/schema-builders/boolean.d.ts.map +1 -1
  22. package/dist/schema-builders/boolean.js +8 -0
  23. package/dist/schema-builders/boolean.js.map +1 -0
  24. package/dist/schema-builders/date.d.ts +47 -44
  25. package/dist/schema-builders/date.d.ts.map +1 -1
  26. package/dist/schema-builders/date.js +8 -0
  27. package/dist/schema-builders/date.js.map +1 -0
  28. package/dist/schema-builders/decimal128.d.ts +66 -64
  29. package/dist/schema-builders/decimal128.d.ts.map +1 -1
  30. package/dist/schema-builders/decimal128.js +27 -0
  31. package/dist/schema-builders/decimal128.js.map +1 -0
  32. package/dist/schema-builders/index.d.ts +8 -15
  33. package/dist/schema-builders/index.js +9 -0
  34. package/dist/schema-builders/number.d.ts +47 -44
  35. package/dist/schema-builders/number.d.ts.map +1 -1
  36. package/dist/schema-builders/number.js +8 -0
  37. package/dist/schema-builders/number.js.map +1 -0
  38. package/dist/schema-builders/object-id.d.ts +41 -39
  39. package/dist/schema-builders/object-id.d.ts.map +1 -1
  40. package/dist/schema-builders/object-id.js +9 -0
  41. package/dist/schema-builders/object-id.js.map +1 -0
  42. package/dist/schema-builders/ref.d.ts +42 -40
  43. package/dist/schema-builders/ref.d.ts.map +1 -1
  44. package/dist/schema-builders/ref.js +12 -0
  45. package/dist/schema-builders/ref.js.map +1 -0
  46. package/dist/schema-builders/string.d.ts +95 -92
  47. package/dist/schema-builders/string.d.ts.map +1 -1
  48. package/dist/schema-builders/string.js +38 -0
  49. package/dist/schema-builders/string.js.map +1 -0
  50. package/dist/types/aggregate-paginate.d.ts +68 -64
  51. package/dist/types/aggregate-paginate.d.ts.map +1 -1
  52. package/dist/types/aggregate-paginate.js +1 -0
  53. package/dist/types/data.d.ts +46 -43
  54. package/dist/types/data.d.ts.map +1 -1
  55. package/dist/types/data.js +1 -0
  56. package/dist/types/index.d.ts +80 -76
  57. package/dist/types/index.d.ts.map +1 -1
  58. package/dist/types/index.js +1 -0
  59. package/dist/types/options.d.ts +44 -40
  60. package/dist/types/options.d.ts.map +1 -1
  61. package/dist/types/options.js +1 -0
  62. package/dist/types/paginate.d.ts +110 -106
  63. package/dist/types/paginate.d.ts.map +1 -1
  64. package/dist/types/paginate.js +1 -0
  65. package/dist/types/utils.d.ts +5 -2
  66. package/dist/types/utils.d.ts.map +1 -1
  67. package/dist/types/utils.js +1 -0
  68. package/dist/utils.d.ts +12 -9
  69. package/dist/utils.d.ts.map +1 -1
  70. package/dist/utils.js +98 -0
  71. package/dist/utils.js.map +1 -0
  72. package/package.json +33 -31
  73. package/src/options.ts +2 -2
  74. package/src/plugins/normalize.ts +16 -10
  75. package/src/schema-builders/decimal128.ts +1 -1
  76. package/src/schema-builders/ref.ts +1 -1
  77. package/src/schema-builders/string.ts +1 -1
  78. package/src/types/aggregate-paginate.ts +2 -0
  79. package/src/types/index.ts +2 -2
  80. package/src/types/paginate.ts +2 -0
  81. package/src/utils.ts +4 -4
  82. package/dist/_internals.cjs +0 -6
  83. package/dist/_internals.cjs.map +0 -1
  84. package/dist/_internals.d.ts +0 -3
  85. package/dist/_internals.d.ts.map +0 -1
  86. package/dist/_internals.mjs +0 -4
  87. package/dist/_internals.mjs.map +0 -1
  88. package/dist/constants.cjs +0 -13
  89. package/dist/constants.cjs.map +0 -1
  90. package/dist/constants.mjs +0 -11
  91. package/dist/constants.mjs.map +0 -1
  92. package/dist/options.cjs +0 -17
  93. package/dist/options.cjs.map +0 -1
  94. package/dist/options.mjs +0 -15
  95. package/dist/options.mjs.map +0 -1
  96. package/dist/plugins/normalize.cjs +0 -64
  97. package/dist/plugins/normalize.cjs.map +0 -1
  98. package/dist/plugins/normalize.mjs +0 -56
  99. package/dist/plugins/normalize.mjs.map +0 -1
  100. package/dist/schema-builders/base.cjs +0 -43
  101. package/dist/schema-builders/base.cjs.map +0 -1
  102. package/dist/schema-builders/base.mjs +0 -41
  103. package/dist/schema-builders/base.mjs.map +0 -1
  104. package/dist/schema-builders/boolean.cjs +0 -8
  105. package/dist/schema-builders/boolean.cjs.map +0 -1
  106. package/dist/schema-builders/boolean.mjs +0 -6
  107. package/dist/schema-builders/boolean.mjs.map +0 -1
  108. package/dist/schema-builders/date.cjs +0 -8
  109. package/dist/schema-builders/date.cjs.map +0 -1
  110. package/dist/schema-builders/date.mjs +0 -6
  111. package/dist/schema-builders/date.mjs.map +0 -1
  112. package/dist/schema-builders/decimal128.cjs +0 -32
  113. package/dist/schema-builders/decimal128.cjs.map +0 -1
  114. package/dist/schema-builders/decimal128.mjs +0 -30
  115. package/dist/schema-builders/decimal128.mjs.map +0 -1
  116. package/dist/schema-builders/index.cjs +0 -27
  117. package/dist/schema-builders/index.cjs.map +0 -1
  118. package/dist/schema-builders/index.d.ts.map +0 -1
  119. package/dist/schema-builders/index.mjs +0 -8
  120. package/dist/schema-builders/index.mjs.map +0 -1
  121. package/dist/schema-builders/number.cjs +0 -8
  122. package/dist/schema-builders/number.cjs.map +0 -1
  123. package/dist/schema-builders/number.mjs +0 -6
  124. package/dist/schema-builders/number.mjs.map +0 -1
  125. package/dist/schema-builders/object-id.cjs +0 -9
  126. package/dist/schema-builders/object-id.cjs.map +0 -1
  127. package/dist/schema-builders/object-id.mjs +0 -7
  128. package/dist/schema-builders/object-id.mjs.map +0 -1
  129. package/dist/schema-builders/ref.cjs +0 -12
  130. package/dist/schema-builders/ref.cjs.map +0 -1
  131. package/dist/schema-builders/ref.mjs +0 -10
  132. package/dist/schema-builders/ref.mjs.map +0 -1
  133. package/dist/schema-builders/string.cjs +0 -46
  134. package/dist/schema-builders/string.cjs.map +0 -1
  135. package/dist/schema-builders/string.mjs +0 -44
  136. package/dist/schema-builders/string.mjs.map +0 -1
  137. package/dist/types/aggregate-paginate.cjs +0 -14
  138. package/dist/types/aggregate-paginate.cjs.map +0 -1
  139. package/dist/types/aggregate-paginate.mjs +0 -10
  140. package/dist/types/aggregate-paginate.mjs.map +0 -1
  141. package/dist/types/data.cjs +0 -3
  142. package/dist/types/data.cjs.map +0 -1
  143. package/dist/types/data.mjs +0 -2
  144. package/dist/types/data.mjs.map +0 -1
  145. package/dist/types/index.cjs +0 -3
  146. package/dist/types/index.cjs.map +0 -1
  147. package/dist/types/index.mjs +0 -2
  148. package/dist/types/index.mjs.map +0 -1
  149. package/dist/types/options.cjs +0 -3
  150. package/dist/types/options.cjs.map +0 -1
  151. package/dist/types/options.mjs +0 -2
  152. package/dist/types/options.mjs.map +0 -1
  153. package/dist/types/paginate.cjs +0 -8
  154. package/dist/types/paginate.cjs.map +0 -1
  155. package/dist/types/paginate.mjs +0 -4
  156. package/dist/types/paginate.mjs.map +0 -1
  157. package/dist/types/utils.cjs +0 -3
  158. package/dist/types/utils.cjs.map +0 -1
  159. package/dist/types/utils.mjs +0 -2
  160. package/dist/types/utils.mjs.map +0 -1
  161. package/dist/utils.cjs +0 -117
  162. package/dist/utils.cjs.map +0 -1
  163. package/dist/utils.mjs +0 -106
  164. package/dist/utils.mjs.map +0 -1
@@ -1 +1 @@
1
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AAU,GAAA,EAAA,GAAA,GAAA,CAqCpE,WArCoE,CAqCxD,CArCwD,CAAA,EAqCpD,CArCoD,CAAA;IAAzD,UAAA,EAAA,GAAA,GAsCL,CAtCK;IAAf,QAAA,EAAA,GAAA,GAuCQ,WAvCR,CAuCoB,CAvCpB,CAAA;;;AAG8B,KAwClC,wBAAA,GAxCkC,OAAA"}
@@ -0,0 +1 @@
1
+ export { };
@@ -1,3 +1,6 @@
1
- export type IfElse<Condition, Then, Else, ReferenceCondition = true> = Condition extends ReferenceCondition ? Then : Else;
2
- export type Readonlyable<T> = Readonly<T> | T;
1
+ //#region src/types/utils.d.ts
2
+ type IfElse<Condition, Then, Else, ReferenceCondition = true> = Condition extends ReferenceCondition ? Then : Else;
3
+ type Readonlyable<T> = Readonly<T> | T;
4
+ //#endregion
5
+ export { IfElse, Readonlyable };
3
6
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,MAAM,CACd,SAAS,EACT,IAAI,EACJ,IAAI,EACJ,kBAAkB,GAAG,IAAI,IACzB,SAAS,SAAS,kBAAkB,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvD,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","names":[],"sources":["../../src/types/utils.ts"],"sourcesContent":[],"mappings":";KAAY,2DAKR,kBAAkB,qBAAqB,OAAO;AALtC,KAOA,YAPM,CAAA,CAAA,CAAA,GAOY,QAPZ,CAOqB,CAPrB,CAAA,GAO0B,CAP1B"}
@@ -0,0 +1 @@
1
+ export { };
package/dist/utils.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { Types } from 'mongoose';
2
- import type { mongo, Schema } from 'mongoose';
3
- import type { setCustomMongooseOptions } from './options';
4
- import type { BuildMongooseModelOptions } from './types/options';
5
- export type DoNotRemoveOrUseThisType = typeof setCustomMongooseOptions;
1
+ import { BuildMongooseModelOptions } from "./types/options.js";
2
+ import { setCustomMongooseOptions } from "./options.js";
3
+ import { Schema, Types, mongo } from "mongoose";
4
+
5
+ //#region src/utils.d.ts
6
+ type DoNotRemoveOrUseThisType = typeof setCustomMongooseOptions;
6
7
  /**
7
8
  * Asserts that a Mongoose update operation was successful by checking that it was acknowledged
8
9
  * and that at least the expected number of documents were modified.
@@ -17,7 +18,7 @@ export type DoNotRemoveOrUseThisType = typeof setCustomMongooseOptions;
17
18
  * - The operation was not acknowledged by MongoDB,
18
19
  * - Fewer documents were modified than expected.
19
20
  */
20
- export declare function assertMongooseUpdateSuccess<T extends mongo.BSON.Document>(updatePromise: Promise<mongo.UpdateResult<T>>, expectedModifiedCount?: number): Promise<void>;
21
+ declare function assertMongooseUpdateSuccess<T extends mongo.BSON.Document>(updatePromise: Promise<mongo.UpdateResult<T>>, expectedModifiedCount?: number): Promise<void>;
21
22
  /**
22
23
  * Builds and returns a Mongoose model with specified schema and options.
23
24
  *
@@ -45,7 +46,7 @@ export declare function assertMongooseUpdateSuccess<T extends mongo.BSON.Documen
45
46
  *
46
47
  * @returns The created Mongoose model.
47
48
  */
48
- export declare function buildMongooseModel<DocType, Model extends BaseMongoosePaginateModel<DocType, InstanceMethodsAndOverrides, QueryHelpers>, InstanceMethodsAndOverrides = object, QueryHelpers = object>(collection: string, name: string, schema: Schema<DocType, Model, InstanceMethodsAndOverrides, QueryHelpers>, options?: BuildMongooseModelOptions): Model;
49
+ declare function buildMongooseModel<DocType, Model extends BaseMongoosePaginateModel<DocType, InstanceMethodsAndOverrides, QueryHelpers>, InstanceMethodsAndOverrides = object, QueryHelpers = object>(collection: string, name: string, schema: Schema<DocType, Model, InstanceMethodsAndOverrides, QueryHelpers>, options?: BuildMongooseModelOptions): Model;
49
50
  /**
50
51
  * Converts a document or ObjectId to a document using the specified model.
51
52
  *
@@ -63,7 +64,7 @@ export declare function buildMongooseModel<DocType, Model extends BaseMongoosePa
63
64
  *
64
65
  * @returns The corresponding document or null if not found.
65
66
  */
66
- export declare function mongooseDocumentOrObjectIdToDocument<D extends MongooseHydratedDocument<DocType, InstanceMethodsAndOverrides, QueryHelpers>, DocType, InstanceMethodsAndOverrides, QueryHelpers>(documentOrObjectId: MongooseDocumentOrObjectId<D>, model: BaseMongoosePaginateModel<DocType, InstanceMethodsAndOverrides, QueryHelpers>, selectFields?: string[]): Promise<D | null>;
67
+ declare function mongooseDocumentOrObjectIdToDocument<D extends MongooseHydratedDocument<DocType, InstanceMethodsAndOverrides, QueryHelpers>, DocType, InstanceMethodsAndOverrides, QueryHelpers>(documentOrObjectId: MongooseDocumentOrObjectId<D>, model: BaseMongoosePaginateModel<DocType, InstanceMethodsAndOverrides, QueryHelpers>, selectFields?: string[]): Promise<D | null>;
67
68
  /**
68
69
  * Converts the input, which can be a MongoDB ObjectId or a string,
69
70
  * into a 24-character hexadecimal string representation of the ObjectId.
@@ -72,5 +73,7 @@ export declare function mongooseDocumentOrObjectIdToDocument<D extends MongooseH
72
73
  *
73
74
  * @returns {string} The hexadecimal string representation of the ObjectId
74
75
  */
75
- export declare function toObjectIdHexString(id: string | Types.ObjectId): string;
76
+ declare function toObjectIdHexString(id: string | Types.ObjectId): string;
77
+ //#endregion
78
+ export { DoNotRemoveOrUseThisType, assertMongooseUpdateSuccess, buildMongooseModel, mongooseDocumentOrObjectIdToDocument, toObjectIdHexString };
76
79
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAiB,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,KAAK,EACR,KAAK,EACL,MAAM,EACT,MAAM,UAAU,CAAC;AAMlB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,WAAW,CAAC;AAE1D,OAAO,KAAK,EAAE,yBAAyB,EA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AzC0C,KAAA,CAAM,IAAA,CAAK,QAyCrD,CAAA,CAAA,aAAA,EAxCC,OAwCD,CAxCS,KAAA,CAAM,YAwCf,CAxC4B,CAwC5B,CAAA,CAAA,EAAA,qBAAA,CAAA,EAAA,MAAA,CAAA,EAtCf,OAsCe,CAAA,IAAA,CAAA;;;;;;;;;AAuClB;;;;;;;;;;;;;;;AAyBA;;;;iBAlEgB,0CAEE,0BAA0B,SAAS,6BAA6B,sHAMtE,OAAO,SAAS,OAAO,6BAA6B,yBAClD,4BACX;;;;;;;;;;;;;;;;;;iBA+BmB,+CACR,yBAAyB,SAAS,6BAA6B,uFAKrD,2BAA2B,WACxC,0BAA0B,SAAS,6BAA6B,yCAExE,QAAQ;;;;;;;;;iBAgBK,mBAAA,cAAiC,KAAA,CAAM"}
package/dist/utils.js ADDED
@@ -0,0 +1,98 @@
1
+ import { mongooseConnections } from "./constants.js";
2
+ import { customMongooseOptions } from "./_internals.js";
3
+ import { mongooseNormalizePlugin } from "./plugins/normalize.js";
4
+ import mongoose, { Types } from "mongoose";
5
+ import mongooseAggregatePaginate from "mongoose-aggregate-paginate-v2";
6
+ import mongoosePaginate from "mongoose-paginate-v2";
7
+
8
+ //#region src/utils.ts
9
+ /**
10
+ * Asserts that a Mongoose update operation was successful by checking that it was acknowledged
11
+ * and that at least the expected number of documents were modified.
12
+ *
13
+ * This function is intended for use with `updateOne`, `updateMany`, or any update operation
14
+ * that returns a MongoDB `UpdateResult`.
15
+ *
16
+ * @template T - The shape of the document being updated.
17
+ * @param updatePromise - A promise returned from a Mongoose update operation.
18
+ * @param expectedModifiedCount - The minimum number of documents expected to be modified. Defaults to 1.
19
+ * @throws Will throw an error if:
20
+ * - The operation was not acknowledged by MongoDB,
21
+ * - Fewer documents were modified than expected.
22
+ */
23
+ async function assertMongooseUpdateSuccess(updatePromise, expectedModifiedCount = 1) {
24
+ const updateResult = await updatePromise;
25
+ if (!updateResult.acknowledged) throw new Error("Update was not acknowledged");
26
+ if (updateResult.modifiedCount < expectedModifiedCount) throw new Error(`Expected to modify at least ${expectedModifiedCount} document(s), but modified ${updateResult.modifiedCount}`);
27
+ }
28
+ /**
29
+ * Builds and returns a Mongoose model with specified schema and options.
30
+ *
31
+ * This function sets up a Mongoose model with optional plugins and timestamp settings.
32
+ * It can optionally use a specified connection or the default connection.
33
+ *
34
+ * Determine the connection to use:
35
+ * 1. Use the connection provided in the options, if available.
36
+ * 2. Otherwise, use the default connection stored in `mongooseConnections`.
37
+ * 3. If there's no default connection, create one using the MongoDB URI from the environment variables,
38
+ * or fallback to a local MongoDB instance.
39
+ *
40
+ * You can set a function to be executed before the final build by using {@link setCustomMongooseOptions}.
41
+ * However, ensure that this option is configured before calling {@link buildMongooseModel}.
42
+ *
43
+ * @template DocType - The type of the document.
44
+ * @template Model - The type of the model, which extends `BaseMongoosePaginateModel`.
45
+ * @template InstanceMethodsAndOverrides - The type for instance methods and overrides.
46
+ * @template QueryHelpers - The type for additional query helpers.
47
+ *
48
+ * @param collection - The name of the collection.
49
+ * @param name - The name of the model.
50
+ * @param schema - The Mongoose schema to use for the model.
51
+ * @param options - Optional settings for building the model.
52
+ *
53
+ * @returns The created Mongoose model.
54
+ */
55
+ function buildMongooseModel(collection, name, schema, options) {
56
+ if (options?.enableNormalizePlugin !== false) schema.plugin(mongooseNormalizePlugin, options?.normalizePluginOptions);
57
+ schema.plugin(mongooseAggregatePaginate);
58
+ schema.plugin(mongoosePaginate);
59
+ schema.set("timestamps", options?.timestamps ?? schema.get("timestamps") ?? true);
60
+ customMongooseOptions.beforeModelBuild?.(schema);
61
+ return (options?.connection || (mongooseConnections.default ||= mongoose.createConnection(process.env.MONGODB_URI || "mongodb://127.0.0.1:27017"))).model(name, schema, collection);
62
+ }
63
+ /**
64
+ * Converts a document or ObjectId to a document using the specified model.
65
+ *
66
+ * This function takes a document or ObjectId and returns the corresponding document
67
+ * from the database using the specified model. Optionally, specific fields can be selected.
68
+ *
69
+ * @template D - The type of the hydrated document.
70
+ * @template DocType - The type of the document.
71
+ * @template InstanceMethodsAndOverrides - The type for instance methods and overrides.
72
+ * @template QueryHelpers - The type for additional query helpers.
73
+ *
74
+ * @param documentOrObjectId - The document or ObjectId to convert.
75
+ * @param model - The Mongoose model to use for the conversion.
76
+ * @param selectFields - Optional fields to select from the document.
77
+ *
78
+ * @returns The corresponding document or null if not found.
79
+ */
80
+ async function mongooseDocumentOrObjectIdToDocument(documentOrObjectId, model, selectFields) {
81
+ if (typeof documentOrObjectId === "string" || documentOrObjectId instanceof Types.ObjectId) return await model.findById(documentOrObjectId).select(selectFields || []);
82
+ return documentOrObjectId;
83
+ }
84
+ /**
85
+ * Converts the input, which can be a MongoDB ObjectId or a string,
86
+ * into a 24-character hexadecimal string representation of the ObjectId.
87
+ *
88
+ * @param {string | Types.ObjectId} id - The ObjectId instance or its string representation
89
+ *
90
+ * @returns {string} The hexadecimal string representation of the ObjectId
91
+ */
92
+ function toObjectIdHexString(id) {
93
+ return id instanceof Types.ObjectId ? id.toHexString() : id;
94
+ }
95
+
96
+ //#endregion
97
+ export { assertMongooseUpdateSuccess, buildMongooseModel, mongooseDocumentOrObjectIdToDocument, toObjectIdHexString };
98
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import mongoose, { Types } from 'mongoose';\nimport type {\n mongo,\n Schema,\n} from 'mongoose';\nimport mongooseAggregatePaginate from 'mongoose-aggregate-paginate-v2';\nimport mongoosePaginate from 'mongoose-paginate-v2';\n\nimport { customMongooseOptions } from './_internals';\nimport { mongooseConnections } from './constants';\nimport type { setCustomMongooseOptions } from './options';\nimport { mongooseNormalizePlugin } from './plugins/normalize';\nimport type { BuildMongooseModelOptions } from './types/options';\n\nexport type DoNotRemoveOrUseThisType = typeof setCustomMongooseOptions;\n\n/**\n * Asserts that a Mongoose update operation was successful by checking that it was acknowledged\n * and that at least the expected number of documents were modified.\n *\n * This function is intended for use with `updateOne`, `updateMany`, or any update operation\n * that returns a MongoDB `UpdateResult`.\n *\n * @template T - The shape of the document being updated.\n * @param updatePromise - A promise returned from a Mongoose update operation.\n * @param expectedModifiedCount - The minimum number of documents expected to be modified. Defaults to 1.\n * @throws Will throw an error if:\n * - The operation was not acknowledged by MongoDB,\n * - Fewer documents were modified than expected.\n */\nexport async function assertMongooseUpdateSuccess<T extends mongo.BSON.Document>(\n updatePromise: Promise<mongo.UpdateResult<T>>,\n expectedModifiedCount = 1,\n): Promise<void> {\n const updateResult = await updatePromise;\n if (!updateResult.acknowledged) throw new Error('Update was not acknowledged');\n if (updateResult.modifiedCount < expectedModifiedCount) {\n // eslint-disable-next-line style/max-len\n throw new Error(`Expected to modify at least ${expectedModifiedCount} document(s), but modified ${updateResult.modifiedCount}`);\n }\n}\n\n/**\n * Builds and returns a Mongoose model with specified schema and options.\n *\n * This function sets up a Mongoose model with optional plugins and timestamp settings.\n * It can optionally use a specified connection or the default connection.\n *\n * Determine the connection to use:\n * 1. Use the connection provided in the options, if available.\n * 2. Otherwise, use the default connection stored in `mongooseConnections`.\n * 3. If there's no default connection, create one using the MongoDB URI from the environment variables,\n * or fallback to a local MongoDB instance.\n *\n * You can set a function to be executed before the final build by using {@link setCustomMongooseOptions}.\n * However, ensure that this option is configured before calling {@link buildMongooseModel}.\n *\n * @template DocType - The type of the document.\n * @template Model - The type of the model, which extends `BaseMongoosePaginateModel`.\n * @template InstanceMethodsAndOverrides - The type for instance methods and overrides.\n * @template QueryHelpers - The type for additional query helpers.\n *\n * @param collection - The name of the collection.\n * @param name - The name of the model.\n * @param schema - The Mongoose schema to use for the model.\n * @param options - Optional settings for building the model.\n *\n * @returns The created Mongoose model.\n */\nexport function buildMongooseModel<\n DocType,\n Model extends BaseMongoosePaginateModel<DocType, InstanceMethodsAndOverrides, QueryHelpers>,\n InstanceMethodsAndOverrides = object,\n QueryHelpers = object,\n>(\n collection: string,\n name: string,\n schema: Schema<DocType, Model, InstanceMethodsAndOverrides, QueryHelpers>,\n options?: BuildMongooseModelOptions,\n): Model {\n if (options?.enableNormalizePlugin !== false) {\n schema.plugin(mongooseNormalizePlugin, options?.normalizePluginOptions);\n }\n\n schema.plugin(mongooseAggregatePaginate);\n schema.plugin(mongoosePaginate);\n schema.set('timestamps', options?.timestamps ?? schema.get('timestamps') ?? true);\n customMongooseOptions.beforeModelBuild?.(schema);\n // eslint-disable-next-line style/max-len\n const connection = options?.connection || (mongooseConnections.default ||= mongoose.createConnection(process.env.MONGODB_URI || 'mongodb://127.0.0.1:27017'));\n return connection.model<DocType, Model, QueryHelpers>(name, schema, collection);\n}\n\n/**\n * Converts a document or ObjectId to a document using the specified model.\n *\n * This function takes a document or ObjectId and returns the corresponding document\n * from the database using the specified model. Optionally, specific fields can be selected.\n *\n * @template D - The type of the hydrated document.\n * @template DocType - The type of the document.\n * @template InstanceMethodsAndOverrides - The type for instance methods and overrides.\n * @template QueryHelpers - The type for additional query helpers.\n *\n * @param documentOrObjectId - The document or ObjectId to convert.\n * @param model - The Mongoose model to use for the conversion.\n * @param selectFields - Optional fields to select from the document.\n *\n * @returns The corresponding document or null if not found.\n */\nexport async function mongooseDocumentOrObjectIdToDocument<\n D extends MongooseHydratedDocument<DocType, InstanceMethodsAndOverrides, QueryHelpers>,\n DocType,\n InstanceMethodsAndOverrides,\n QueryHelpers,\n>(\n documentOrObjectId: MongooseDocumentOrObjectId<D>,\n model: BaseMongoosePaginateModel<DocType, InstanceMethodsAndOverrides, QueryHelpers>,\n selectFields?: string[],\n): Promise<D | null> {\n if (typeof documentOrObjectId === 'string' || documentOrObjectId instanceof Types.ObjectId) {\n return (await model.findById(documentOrObjectId).select(selectFields || [])) as D | null;\n }\n\n return documentOrObjectId;\n}\n\n/**\n * Converts the input, which can be a MongoDB ObjectId or a string,\n * into a 24-character hexadecimal string representation of the ObjectId.\n *\n * @param {string | Types.ObjectId} id - The ObjectId instance or its string representation\n *\n * @returns {string} The hexadecimal string representation of the ObjectId\n */\nexport function toObjectIdHexString(id: string | Types.ObjectId): string {\n return id instanceof Types.ObjectId ? id.toHexString() : id;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA8BA,eAAsB,4BAClB,eACA,wBAAwB,GACX;CACb,MAAM,eAAe,MAAM;AAC3B,KAAI,CAAC,aAAa,aAAc,OAAM,IAAI,MAAM,8BAA8B;AAC9E,KAAI,aAAa,gBAAgB,sBAE7B,OAAM,IAAI,MAAM,+BAA+B,sBAAsB,6BAA6B,aAAa,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BvI,SAAgB,mBAMZ,YACA,MACA,QACA,SACK;AACL,KAAI,SAAS,0BAA0B,MACnC,QAAO,OAAO,yBAAyB,SAAS,uBAAuB;AAG3E,QAAO,OAAO,0BAA0B;AACxC,QAAO,OAAO,iBAAiB;AAC/B,QAAO,IAAI,cAAc,SAAS,cAAc,OAAO,IAAI,aAAa,IAAI,KAAK;AACjF,uBAAsB,mBAAmB,OAAO;AAGhD,SADmB,SAAS,eAAe,oBAAoB,YAAY,SAAS,iBAAiB,QAAQ,IAAI,eAAe,4BAA4B,GAC1I,MAAoC,MAAM,QAAQ,WAAW;;;;;;;;;;;;;;;;;;;AAoBnF,eAAsB,qCAMlB,oBACA,OACA,cACiB;AACjB,KAAI,OAAO,uBAAuB,YAAY,8BAA8B,MAAM,SAC9E,QAAQ,MAAM,MAAM,SAAS,mBAAmB,CAAC,OAAO,gBAAgB,EAAE,CAAC;AAG/E,QAAO;;;;;;;;;;AAWX,SAAgB,oBAAoB,IAAqC;AACrE,QAAO,cAAc,MAAM,WAAW,GAAG,aAAa,GAAG"}
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@kikiutils/mongoose",
3
- "version": "4.0.1",
3
+ "type": "module",
4
+ "version": "5.0.1",
4
5
  "description": "A Mongoose plugin for enhanced JSON normalization and common schema creation, with built-in support for pagination and automatic Decimal128 conversion.",
5
6
  "author": "kiki-kanri",
6
7
  "license": "MIT",
@@ -20,37 +21,36 @@
20
21
  ],
21
22
  "sideEffects": false,
22
23
  "exports": {
23
- "./*": {
24
- "types": "./dist/*.d.ts",
25
- "import": "./dist/*.mjs",
26
- "require": "./dist/*.cjs"
27
- },
28
- "./_internals": {
29
- "types": null,
30
- "import": null,
31
- "require": null
32
- },
33
- "./schema-builders": {
34
- "types": "./dist/schema-builders/index.d.ts",
35
- "import": "./dist/schema-builders/index.mjs",
36
- "require": "./dist/schema-builders/index.cjs"
37
- },
38
- "./types": {
39
- "types": "./dist/types/index.d.ts"
40
- },
41
- "./types/*": {
42
- "types": "./dist/types/*.d.ts"
43
- }
24
+ "./constants": "./dist/constants.js",
25
+ "./options": "./dist/options.js",
26
+ "./plugins/normalize": "./dist/plugins/normalize.js",
27
+ "./schema-builders": "./dist/schema-builders/index.js",
28
+ "./schema-builders/base": "./dist/schema-builders/base.js",
29
+ "./schema-builders/boolean": "./dist/schema-builders/boolean.js",
30
+ "./schema-builders/date": "./dist/schema-builders/date.js",
31
+ "./schema-builders/decimal128": "./dist/schema-builders/decimal128.js",
32
+ "./schema-builders/number": "./dist/schema-builders/number.js",
33
+ "./schema-builders/object-id": "./dist/schema-builders/object-id.js",
34
+ "./schema-builders/ref": "./dist/schema-builders/ref.js",
35
+ "./schema-builders/string": "./dist/schema-builders/string.js",
36
+ "./types": "./dist/types/index.js",
37
+ "./types/aggregate-paginate": "./dist/types/aggregate-paginate.js",
38
+ "./types/data": "./dist/types/data.js",
39
+ "./types/options": "./dist/types/options.js",
40
+ "./types/paginate": "./dist/types/paginate.js",
41
+ "./types/utils": "./dist/types/utils.js",
42
+ "./utils": "./dist/utils.js",
43
+ "./package.json": "./package.json"
44
44
  },
45
45
  "files": [
46
46
  "./dist",
47
47
  "./src"
48
48
  ],
49
49
  "engines": {
50
- "node": ">=20.0.0"
50
+ "node": ">=22.0.0"
51
51
  },
52
52
  "scripts": {
53
- "build": "ts-project-builder './src/**/*.ts' --clean --preserve-modules --sourcemaps",
53
+ "build": "tsdown",
54
54
  "bumplog": "changelogen --bump --hideAuthorEmail",
55
55
  "depcheck": "depcheck",
56
56
  "lint": "eslint --max-warnings 0",
@@ -64,23 +64,25 @@
64
64
  },
65
65
  "dependencies": {
66
66
  "decimal.js": "^10.6.0",
67
- "lodash": "^4.17.21",
67
+ "es-toolkit": "^1.39.10",
68
68
  "mongoose": "^8.18.1",
69
69
  "mongoose-aggregate-paginate-v2": "^1.1.4",
70
70
  "mongoose-paginate-v2": "^1.9.1",
71
- "type-fest": "^4.41.0"
71
+ "type-fest": "^5.0.0"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@kikiutils/changelogen": "^0.9.0",
75
- "@kikiutils/eslint-config": "^2.1.1",
76
- "@kikiutils/tsconfigs": "^5.0.4",
77
- "@types/lodash": "^4.17.20",
78
- "@types/node": "^24.3.1",
75
+ "@kikiutils/eslint-config": "^3.0.0",
76
+ "@kikiutils/tsconfigs": "^5.0.5",
77
+ "@types/node": "^24.3.3",
79
78
  "@vitest/coverage-v8": "^3.2.4",
80
79
  "depcheck": "^1.4.7",
81
- "ts-project-builder": "^5.0.2",
80
+ "publint": "^0.3.12",
82
81
  "ts-unused-exports": "^11.0.1",
82
+ "tsconfck": "^3.1.6",
83
+ "tsdown": "^0.15.1",
83
84
  "typescript": "^5.9.2",
85
+ "unplugin-unused": "^0.5.3",
84
86
  "vitest": "^3.2.4"
85
87
  },
86
88
  "pnpm": {
package/src/options.ts CHANGED
@@ -14,6 +14,6 @@ export type DoNotRemoveOrUseThisType = typeof buildMongooseModel;
14
14
  export function setCustomMongooseOptions<K extends keyof CustomMongooseOptions>(
15
15
  key: K,
16
16
  value: CustomMongooseOptions[K],
17
- ) {
18
- return customMongooseOptions[key] = value;
17
+ ): void {
18
+ customMongooseOptions[key] = value;
19
19
  }
@@ -1,9 +1,8 @@
1
- // @ts-expect-error Ignore this error.
2
- import lodashGet from 'lodash/get.js';
3
- // @ts-expect-error Ignore this error.
4
- import lodashSet from 'lodash/set.js';
5
- // @ts-expect-error Ignore this error.
6
- import lodashUnset from 'lodash/unset.js';
1
+ import {
2
+ get as getProp,
3
+ set as setProp,
4
+ unset as unsetProp,
5
+ } from 'es-toolkit/compat';
7
6
  import { Types } from 'mongoose';
8
7
  import type { Schema } from 'mongoose';
9
8
 
@@ -38,7 +37,10 @@ export interface MongooseNormalizePluginOptions {
38
37
  *
39
38
  * @param schema - The Mongoose schema to apply the plugin to.
40
39
  */
41
- export function mongooseNormalizePlugin<S extends Schema>(schema: S, pluginOptions?: MongooseNormalizePluginOptions) {
40
+ export function mongooseNormalizePlugin<S extends Schema>(
41
+ schema: S,
42
+ pluginOptions?: MongooseNormalizePluginOptions,
43
+ ): void {
42
44
  const toJson = schema.get('toJSON');
43
45
  const toJsonTransform = toJson?.transform;
44
46
  schema.set(
@@ -58,10 +60,14 @@ export function mongooseNormalizePlugin<S extends Schema>(schema: S, pluginOptio
58
60
  }
59
61
 
60
62
  for (const path in schema.paths) {
61
- if (schema.paths[path]?.options?.private) lodashUnset(copiedRet, path);
63
+ if (schema.paths[path]?.options?.private) {
64
+ unsetProp(copiedRet, path);
65
+ continue;
66
+ }
67
+
62
68
  if (schema.paths[path]?.instance === 'Decimal128') {
63
- const value: Types.Decimal128 | undefined = lodashGet(copiedRet, path);
64
- if (value) lodashSet(copiedRet, path, value.toString());
69
+ const value = getProp(copiedRet, path) as Types.Decimal128 | undefined;
70
+ if (value) setProp(copiedRet, path, value.toString());
65
71
  }
66
72
  }
67
73
 
@@ -100,7 +100,7 @@ interface ToStringSetterSchema {
100
100
 
101
101
  const baseBuilderFactory = createBaseSchemaBuilderFactory(Schema.Types.Decimal128);
102
102
 
103
- export function decimal128SchemaBuilder() {
103
+ export function decimal128SchemaBuilder(): Decimal128SchemaBuilder {
104
104
  const schema: Record<string, any> = {};
105
105
  const baseBuilder = baseBuilderFactory(schema);
106
106
  return new Proxy(
@@ -64,6 +64,6 @@ const baseBuilderFactory = createBaseSchemaBuilderFactory(Schema.Types.ObjectId)
64
64
 
65
65
  export function refSchemaBuilder<T extends ((this: any, doc: any) => Model<any> | string) | Model<any> | string>(
66
66
  ref: T,
67
- ) {
67
+ ): RefSchemaBuilder<{ ref: T; type: typeof Schema.Types.ObjectId }> {
68
68
  return baseBuilderFactory({ ref }) as RefSchemaBuilder<{ ref: T; type: typeof Schema.Types.ObjectId }>;
69
69
  }
@@ -139,7 +139,7 @@ const baseBuilderFactory = createBaseSchemaBuilderFactory(String);
139
139
  const defaultIpv4ValidateMessage = '`{VALUE}` is not a valid IPv4 address for path `{PATH}`';
140
140
  const defaultIpv6ValidateMessage = '`{VALUE}` is not a valid IPv6 address for path `{PATH}`';
141
141
 
142
- export function stringSchemaBuilder() {
142
+ export function stringSchemaBuilder(): StringSchemaBuilder {
143
143
  const schema: Record<string, any> = {};
144
144
  const baseBuilder = baseBuilderFactory(schema);
145
145
  return new Proxy(
@@ -100,4 +100,6 @@ declare namespace _ {
100
100
  const aggregatePaginate: { options: AggregatePaginateOptions };
101
101
  }
102
102
 
103
+ export type DoNotRemoveOrUseThisType = unknown;
104
+
103
105
  export default mongooseAggregatePaginate;
@@ -10,8 +10,8 @@ import type { SetFieldType } from 'type-fest';
10
10
 
11
11
  import type { IfElse } from './utils';
12
12
 
13
- export type {} from './aggregate-paginate';
14
- export type {} from './paginate';
13
+ export type { DoNotRemoveOrUseThisType as _ADoNotRemoveOrUseThisType } from './aggregate-paginate';
14
+ export type { DoNotRemoveOrUseThisType as _PDoNotRemoveOrUseThisType } from './paginate';
15
15
 
16
16
  // @ts-expect-error Ignore this error.
17
17
  // eslint-disable-next-line unused-imports/no-unused-vars
@@ -172,4 +172,6 @@ declare namespace _ {
172
172
  }
173
173
  }
174
174
 
175
+ export type DoNotRemoveOrUseThisType = unknown;
176
+
175
177
  export default _;
package/src/utils.ts CHANGED
@@ -31,7 +31,7 @@ export type DoNotRemoveOrUseThisType = typeof setCustomMongooseOptions;
31
31
  export async function assertMongooseUpdateSuccess<T extends mongo.BSON.Document>(
32
32
  updatePromise: Promise<mongo.UpdateResult<T>>,
33
33
  expectedModifiedCount = 1,
34
- ) {
34
+ ): Promise<void> {
35
35
  const updateResult = await updatePromise;
36
36
  if (!updateResult.acknowledged) throw new Error('Update was not acknowledged');
37
37
  if (updateResult.modifiedCount < expectedModifiedCount) {
@@ -77,7 +77,7 @@ export function buildMongooseModel<
77
77
  name: string,
78
78
  schema: Schema<DocType, Model, InstanceMethodsAndOverrides, QueryHelpers>,
79
79
  options?: BuildMongooseModelOptions,
80
- ) {
80
+ ): Model {
81
81
  if (options?.enableNormalizePlugin !== false) {
82
82
  schema.plugin(mongooseNormalizePlugin, options?.normalizePluginOptions);
83
83
  }
@@ -117,7 +117,7 @@ export async function mongooseDocumentOrObjectIdToDocument<
117
117
  documentOrObjectId: MongooseDocumentOrObjectId<D>,
118
118
  model: BaseMongoosePaginateModel<DocType, InstanceMethodsAndOverrides, QueryHelpers>,
119
119
  selectFields?: string[],
120
- ) {
120
+ ): Promise<D | null> {
121
121
  if (typeof documentOrObjectId === 'string' || documentOrObjectId instanceof Types.ObjectId) {
122
122
  return (await model.findById(documentOrObjectId).select(selectFields || [])) as D | null;
123
123
  }
@@ -133,6 +133,6 @@ export async function mongooseDocumentOrObjectIdToDocument<
133
133
  *
134
134
  * @returns {string} The hexadecimal string representation of the ObjectId
135
135
  */
136
- export function toObjectIdHexString(id: string | Types.ObjectId) {
136
+ export function toObjectIdHexString(id: string | Types.ObjectId): string {
137
137
  return id instanceof Types.ObjectId ? id.toHexString() : id;
138
138
  }
@@ -1,6 +0,0 @@
1
- 'use strict';
2
-
3
- const customMongooseOptions = {};
4
-
5
- exports.customMongooseOptions = customMongooseOptions;
6
- //# sourceMappingURL=_internals.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_internals.cjs","sources":["../src/_internals.ts"],"sourcesContent":["import type { CustomMongooseOptions } from './types/options';\n\nexport const customMongooseOptions: CustomMongooseOptions = {};\n"],"names":[],"mappings":";;AAEO,MAAM,qBAAqB,GAA0B;;;;"}
@@ -1,3 +0,0 @@
1
- import type { CustomMongooseOptions } from './types/options';
2
- export declare const customMongooseOptions: CustomMongooseOptions;
3
- //# sourceMappingURL=_internals.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_internals.d.ts","sourceRoot":"","sources":["../src/_internals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,eAAO,MAAM,qBAAqB,EAAE,qBAA0B,CAAC"}
@@ -1,4 +0,0 @@
1
- const customMongooseOptions = {};
2
-
3
- export { customMongooseOptions };
4
- //# sourceMappingURL=_internals.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"_internals.mjs","sources":["../src/_internals.ts"],"sourcesContent":["import type { CustomMongooseOptions } from './types/options';\n\nexport const customMongooseOptions: CustomMongooseOptions = {};\n"],"names":[],"mappings":"AAEO,MAAM,qBAAqB,GAA0B;;;;"}
@@ -1,13 +0,0 @@
1
- 'use strict';
2
-
3
- /**
4
- * Mongoose connections.
5
- *
6
- * This constant is a record of named Mongoose connections, allowing multiple
7
- * database connections to be managed within the application. An optional `default`
8
- * connection can also be specified for use when a specific connection is not provided.
9
- */
10
- const mongooseConnections = {};
11
-
12
- exports.mongooseConnections = mongooseConnections;
13
- //# sourceMappingURL=constants.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.cjs","sources":["../src/constants.ts"],"sourcesContent":["import type { MongooseConnections } from './types';\n\n/**\n * Mongoose connections.\n *\n * This constant is a record of named Mongoose connections, allowing multiple\n * database connections to be managed within the application. An optional `default`\n * connection can also be specified for use when a specific connection is not provided.\n */\nexport const mongooseConnections: MongooseConnections = {};\n"],"names":[],"mappings":";;AAEA;;;;;;AAMG;AACI,MAAM,mBAAmB,GAAwB;;;;"}
@@ -1,11 +0,0 @@
1
- /**
2
- * Mongoose connections.
3
- *
4
- * This constant is a record of named Mongoose connections, allowing multiple
5
- * database connections to be managed within the application. An optional `default`
6
- * connection can also be specified for use when a specific connection is not provided.
7
- */
8
- const mongooseConnections = {};
9
-
10
- export { mongooseConnections };
11
- //# sourceMappingURL=constants.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.mjs","sources":["../src/constants.ts"],"sourcesContent":["import type { MongooseConnections } from './types';\n\n/**\n * Mongoose connections.\n *\n * This constant is a record of named Mongoose connections, allowing multiple\n * database connections to be managed within the application. An optional `default`\n * connection can also be specified for use when a specific connection is not provided.\n */\nexport const mongooseConnections: MongooseConnections = {};\n"],"names":[],"mappings":"AAEA;;;;;;AAMG;AACI,MAAM,mBAAmB,GAAwB;;;;"}
package/dist/options.cjs DELETED
@@ -1,17 +0,0 @@
1
- 'use strict';
2
-
3
- const _internals = require('./_internals.cjs');
4
-
5
- /**
6
- * Sets custom options.
7
- *
8
- * For example, you can set {@link CustomMongooseOptions.beforeModelBuild} to define a function that will be called
9
- * every time {@link buildMongooseModel} is used. Inside this function, you can modify
10
- * the schema, allowing you to apply common settings to all global schemas.
11
- */
12
- function setCustomMongooseOptions(key, value) {
13
- return _internals.customMongooseOptions[key] = value;
14
- }
15
-
16
- exports.setCustomMongooseOptions = setCustomMongooseOptions;
17
- //# sourceMappingURL=options.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"options.cjs","sources":["../src/options.ts"],"sourcesContent":["import { customMongooseOptions } from './_internals';\nimport type { CustomMongooseOptions } from './types/options';\nimport type { buildMongooseModel } from './utils';\n\nexport type DoNotRemoveOrUseThisType = typeof buildMongooseModel;\n\n/**\n * Sets custom options.\n *\n * For example, you can set {@link CustomMongooseOptions.beforeModelBuild} to define a function that will be called\n * every time {@link buildMongooseModel} is used. Inside this function, you can modify\n * the schema, allowing you to apply common settings to all global schemas.\n */\nexport function setCustomMongooseOptions<K extends keyof CustomMongooseOptions>(\n key: K,\n value: CustomMongooseOptions[K],\n) {\n return customMongooseOptions[key] = value;\n}\n"],"names":["customMongooseOptions"],"mappings":";;;;AAMA;;;;;;AAMG;AACG,SAAU,wBAAwB,CACpC,GAAM,EACN,KAA+B,EAAA;AAE/B,IAAA,OAAOA,gCAAqB,CAAC,GAAG,CAAC,GAAG,KAAK;AAC7C;;;;"}