xzwebx-httpfilter 2.2.9 → 2.4.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 (2) hide show
  1. package/HttpFilter.js +5 -31
  2. package/package.json +1 -1
package/HttpFilter.js CHANGED
@@ -5,6 +5,9 @@ const Path = require('path')
5
5
  let ConfigMap = {}
6
6
  let Fun = {}
7
7
 
8
+ Fun.GetHttpFilterObj = function(port) {
9
+ return ConfigMap[port]
10
+ }
8
11
  Fun.SetModuleMap = function(port, m) {
9
12
  if (!ConfigMap[port]) {
10
13
  ConfigMap[port] = new http()
@@ -177,37 +180,10 @@ class http {
177
180
  continue
178
181
  }
179
182
  let fatherFieldType = fCfgItem.fieldType
180
-
181
- if (fCfgItem.isRecursed) {
182
- if (fatherFieldType === 'LIST') {
183
- for (let key in msgFieldMap) {
184
- if (key == '__FieldCfg') {
185
- continue
186
- }
187
-
188
- if (!msgFieldMap[key]['__FieldCfg'] || msgFieldMap[key]['__FieldCfg'].fieldType !== 'OBJ') {
189
- continue
190
- }
191
-
192
- if (!msgFieldMap[key][fCfgItem.fieldCode]) {
193
- let msgFieldMap1 = JSON.parse(JSON.stringify(msgFieldMap))
194
- msgFieldMap1['__FieldCfg'].ifMust = 'NO'
195
- msgFieldMap[key][fCfgItem.fieldCode] = msgFieldMap1
196
- }
197
- }
198
- } else if (fatherFieldType === 'OBJ') {
199
- if (!msgFieldMap[fCfgItem.fieldCode]) {
200
- let msgFieldMap1 = JSON.parse(JSON.stringify(msgFieldMap))
201
- msgFieldMap1['__FieldCfg'].ifMust = 'NO'
202
- msgFieldMap[fCfgItem.fieldCode] = msgFieldMap1
203
- }
204
- }
205
- }
206
-
207
183
  if (fatherFieldType == 'LIST' || (fatherFieldType == 'OBJ' && fCfgItem.keyType == 'VOBJ')) {
208
184
  if (isRoot) {
209
185
  retMsgData = this.cycleCheckParams(msgFieldMap[fieldName], data)
210
- } else if (data) {
186
+ } else {
211
187
  for (let idx in data) {
212
188
  retMsgData = this.cycleCheckParams(msgFieldMap[fieldName], data[idx])
213
189
  if (retMsgData) {
@@ -219,9 +195,7 @@ class http {
219
195
  if (isRoot) {
220
196
  retMsgData = this.cycleCheckParams(msgFieldMap[fieldName], data)
221
197
  } else {
222
- if (data) {
223
- retMsgData = this.cycleCheckParams(msgFieldMap[fieldName], data[fieldName])
224
- }
198
+ retMsgData = this.cycleCheckParams(msgFieldMap[fieldName], data[fieldName])
225
199
  }
226
200
  }
227
201
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "xzwebx-httpfilter",
3
- "version": "2.2.9",
3
+ "version": "2.4.1",
4
4
  "main": "HttpFilter.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"