Skip to content

Commit

Permalink
imp(core): Modify the entry value of the default setting to undefined…
Browse files Browse the repository at this point in the history
… that permit its overwrite from other mixins.
  • Loading branch information
0x0a0d committed Oct 25, 2023
1 parent 2702ad1 commit 203f613
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions packages/moleculer-db/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ module.exports = {
idField: "_id",

/** @type {Array<String>?} Field filtering list. It must be an `Array`. If the value is `null` or `undefined` doesn't filter the fields of entities. */
fields: null,
fields: undefined,

/** @type {Array<String>?} List of excluded fields. It must be an `Array`. The value is `null` or `undefined` will be ignored. */
excludeFields: null,
excludeFields: undefined,

/** @type {Array?} Schema for population. [Read more](#populating). */
populates: null,
populates: undefined,

/** @type {Number} Default page size in `list` action. */
pageSize: 10,
Expand All @@ -67,7 +67,7 @@ module.exports = {
maxLimit: -1,

/** @type {Object|Function} Validator schema or a function to validate the incoming entity in `create` & 'insert' actions. */
entityValidator: null,
entityValidator: undefined,

/** @type {Boolean} Whether to use dot notation or not when updating an entity. Will **not** convert Array to dot notation. Default: `false` */
useDotNotation: false,
Expand Down
8 changes: 4 additions & 4 deletions packages/moleculer-db/test/unit/index.actions.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@ describe("Test DbService actions", () => {
it("should set default settings", () => {
expect(service.adapter).toEqual(adapter);
expect(service.settings).toEqual({
entityValidator: null,
fields: null,
excludeFields: null,
entityValidator: undefined,
fields: undefined,
excludeFields: undefined,
idField: "_id",
maxLimit: -1,
maxPageSize: 100,
pageSize: 10,
populates: null,
populates: undefined,
useDotNotation: false,
cacheCleanEventType: "broadcast"
});
Expand Down
8 changes: 4 additions & 4 deletions packages/moleculer-db/test/unit/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ describe("Test DbService actions", () => {
it("should set default settings", () => {
expect(service.adapter).toEqual(adapter);
expect(service.settings).toEqual({
entityValidator: null,
fields: null,
excludeFields: null,
entityValidator: undefined,
fields: undefined,
excludeFields: undefined,
idField: "_id",
maxLimit: -1,
maxPageSize: 100,
pageSize: 10,
populates: null,
populates: undefined,
useDotNotation: false,
cacheCleanEventType: "broadcast"
});
Expand Down

0 comments on commit 203f613

Please sign in to comment.