not-node 6.3.55 → 6.3.57

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "6.3.55",
3
+ "version": "6.3.57",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/src/common.js CHANGED
@@ -104,7 +104,8 @@ module.exports.copyObj = (obj) => {
104
104
 
105
105
  /**
106
106
  * Copies object to secure it from changes
107
- * @param {object} obj original object
107
+ * @param {object} obj original object
108
+ * @param {Array<string>} list properties list to include
108
109
  * @return {object} copy of object
109
110
  **/
110
111
  module.exports.partCopyObj = (obj, list) => {
@@ -117,6 +118,22 @@ module.exports.partCopyObj = (obj, list) => {
117
118
  return JSON.parse(JSON.stringify(partObj));
118
119
  };
119
120
 
121
+ /**
122
+ * Copies object to secure it from changes
123
+ * @param {object} obj original object
124
+ * @param {Array<string>} except properties list to exclude
125
+ * @return {object} copy of object
126
+ **/
127
+ module.exports.partCopyObjExcept = (obj, except) => {
128
+ let partObj = Object.keys(obj).reduce((prev, curr) => {
129
+ if (!except.includes(curr)) {
130
+ prev[curr] = obj[curr];
131
+ }
132
+ return prev;
133
+ }, {});
134
+ return JSON.parse(JSON.stringify(partObj));
135
+ };
136
+
120
137
  /**
121
138
  * Test argument type to be 'function'
122
139
  * @param {any} func possible function
@@ -11,9 +11,11 @@ module.exports = ({
11
11
  actionsSets = ["standart"],
12
12
  actions = {},
13
13
  beforeActions = {},
14
- beforeActionsAll = [require('./actions.before/standart.queries.js')],
14
+ beforeActionsAll = [require("./actions.before/standart.queries.js")],
15
15
  afterActions = {},
16
+ populateBuilders = {},
16
17
  afterActionsAll = [],
18
+ defaulPopulate = [],
17
19
  }) => {
18
20
  //start with empty set
19
21
  const ACTIONS = {};
@@ -30,6 +32,8 @@ module.exports = ({
30
32
  MODEL_NAME,
31
33
  target,
32
34
  USER_MODEL_NAME,
35
+ populateBuilders,
36
+ defaulPopulate,
33
37
  });
34
38
 
35
39
  beforeActionsAll.forEach((action) => {