q-koa 8.6.6 → 8.6.7

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.
@@ -16,17 +16,11 @@ exports.getList = (config) => (type) => {
16
16
  }
17
17
 
18
18
  exports.getObject = (config, app) => async (type) => {
19
+ const findConfig = (item) => item.config === type || item.pay_config === type
19
20
  if (app) {
20
21
  const applicationList = app.cache.get('application')
21
- if (
22
- applicationList &&
23
- applicationList.find(
24
- (item) => item.config === type || item.pay_config === type
25
- )
26
- ) {
27
- return applicationList.find(
28
- (item) => item.config === type || item.pay_config === type
29
- )
22
+ if (applicationList && applicationList.find(findConfig)) {
23
+ return applicationList.find(findConfig)
30
24
  }
31
25
 
32
26
  if (!applicationList) {
@@ -36,9 +30,7 @@ exports.getObject = (config, app) => async (type) => {
36
30
  if (result.length > 0) {
37
31
  app.cache.set('application', JSON.parse(JSON.stringify(result)))
38
32
 
39
- const target = result.find(
40
- (item) => item.config === type || item.pay_config === type
41
- )
33
+ const target = result.find(findConfig)
42
34
  if (target) {
43
35
  return target
44
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "8.6.6",
3
+ "version": "8.6.7",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {