@azteam/express 1.2.302 → 1.2.303

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/lib/Server.js CHANGED
@@ -216,13 +216,9 @@ var Server = /*#__PURE__*/function () {
216
216
  responseGuard = [].concat(_toConsumableArray(guard), ['__v', '_id', 'created_at', 'created_id', 'modified_at', 'modified_id', 'deleted_at', 'deleted_id', 'restored_id', 'resource', 'is_processing', 'priority']);
217
217
  }
218
218
  if (resType === RES_TYPE.DOCS) {
219
- guardData.docs = _lodash["default"].map(data.docs, function (item) {
220
- return (0, _util.omitItem)(item, responseGuard, responseAllows);
221
- });
219
+ guardData.docs = (0, _util.omitArrayItem)(data.docs, responseGuard, responseAllows);
222
220
  } else if (resType === RES_TYPE.ARRAY) {
223
- guardData = _lodash["default"].map(data, function (item) {
224
- return (0, _util.omitItem)(item, responseGuard, responseAllows);
225
- });
221
+ guardData = (0, _util.omitArrayItem)(data, responseGuard, responseAllows);
226
222
  } else if (resType === RES_TYPE.OBJECT) {
227
223
  guardData = (0, _util.omitItem)(data, responseGuard, responseAllows);
228
224
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azteam/express",
3
- "version": "1.2.302",
3
+ "version": "1.2.303",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./src/index.js",
6
6
  "scripts": {
package/src/Server.js CHANGED
@@ -13,7 +13,7 @@ import psl from 'psl';
13
13
  import ejs from 'ejs';
14
14
  import 'express-async-errors';
15
15
  import {CORS, errorCatch, ErrorException, NOT_FOUND, UNKNOWN} from '@azteam/error';
16
- import {omitItem} from '@azteam/util';
16
+ import {omitItem, omitArrayItem} from '@azteam/util';
17
17
 
18
18
  const RES_TYPE = {
19
19
  ARRAY: 'ARRAY',
@@ -200,13 +200,9 @@ class Server {
200
200
  ];
201
201
  }
202
202
  if (resType === RES_TYPE.DOCS) {
203
- guardData.docs = _.map(data.docs, (item) => {
204
- return omitItem(item, responseGuard, responseAllows);
205
- });
203
+ guardData.docs = omitArrayItem(data.docs, responseGuard, responseAllows);
206
204
  } else if (resType === RES_TYPE.ARRAY) {
207
- guardData = _.map(data, (item) => {
208
- return omitItem(item, responseGuard, responseAllows);
209
- });
205
+ guardData = omitArrayItem(data, responseGuard, responseAllows);
210
206
  } else if (resType === RES_TYPE.OBJECT) {
211
207
  guardData = omitItem(data, responseGuard, responseAllows);
212
208
  }