@onehat/data 1.8.19 → 1.8.20

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 (2) hide show
  1. package/package.json +11 -11
  2. package/src/OneHatData.js +7 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onehat/data",
3
- "version": "1.8.19",
3
+ "version": "1.8.20",
4
4
  "description": "JS data modeling package with adapters for many storage mediums.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -50,18 +50,18 @@
50
50
  "uuid": "^9.0.0"
51
51
  },
52
52
  "devDependencies": {
53
- "@babel/core": "^7.16.7",
54
- "@babel/node": "^7.16.8",
55
- "@babel/plugin-proposal-class-properties": "^7.16.7",
56
- "@babel/plugin-transform-runtime": "^7.16.8",
57
- "@babel/preset-env": "^7.16.8",
58
- "@babel/register": "^7.16.9",
59
- "@babel/runtime": "^7.16.7",
53
+ "@babel/core": "^7.20.2",
54
+ "@babel/node": "^7.20.2",
55
+ "@babel/plugin-proposal-class-properties": "^7.18.6",
56
+ "@babel/plugin-transform-runtime": "^7.19.6",
57
+ "@babel/preset-env": "^7.20.2",
58
+ "@babel/register": "^7.18.9",
59
+ "@babel/runtime": "^7.20.0",
60
60
  "@cypress/webpack-preprocessor": "^5.11.0",
61
- "babel-loader": "^8.2.2",
61
+ "babel-loader": "^9.1.0",
62
62
  "cypress": "5.2.0",
63
63
  "ink-docstrap": "^1.3.2",
64
- "jsdoc": "^3.6.6",
65
- "webpack": "^4.44.2"
64
+ "jsdoc": "^4.0.0",
65
+ "webpack": "^5.75.0"
66
66
  }
67
67
  }
package/src/OneHatData.js CHANGED
@@ -85,13 +85,18 @@ export class OneHatData extends EventEmitter {
85
85
  * Sets global config settings that will be passed into all Repositories.
86
86
  * Chainable.
87
87
  * @param {object} globals - Schema config object
88
+ * @param {boolean} merge - Whether to merge or replace the globals
88
89
  * @return this
89
90
  */
90
- setRepositoryGlobals = (globals) => {
91
+ setRepositoryGlobals = (globals, merge = true) => {
91
92
  if (this.isDestroyed) {
92
93
  throw new Error('this.setRepositoryGlobals is no longer valid. OneHatData has been destroyed.');
93
94
  }
94
- _.merge(this._repositoryGlobals, globals);
95
+ if (merge) {
96
+ _.merge(this._repositoryGlobals, globals);
97
+ } else {
98
+ _.assign(this._repositoryGlobals, globals);
99
+ }
95
100
  return this;
96
101
  }
97
102