Skip to content

Commit c1e3355

Browse files
authored
修复更新字段值为空时缓存未被删除的问题 (#5)
1 parent b438ece commit c1e3355

File tree

4 files changed

+21
-26
lines changed

4 files changed

+21
-26
lines changed
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
22
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
33

4-
name: CI
4+
name: Build
55

66
on:
77
push:
@@ -22,10 +22,5 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v2
2424

25-
- name: Use Node.js
26-
uses: actions/setup-node@v1
27-
with:
28-
node-version: 12
29-
3025
- run: yarn
3126
- run: yarn build

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"mysql": "^2.18.1"
3131
},
3232
"devDependencies": {
33-
"@types/node": "^14.14.35",
34-
"typescript": "^4.2.3"
33+
"@types/node": "^14.14.37",
34+
"typescript": "^4.2.4"
3535
}
3636
}

src/MysqlCache.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export class MysqlCache<Scheme> extends MysqlNative<Scheme> {
148148
let has = true
149149
const resultList = [] as CoaMysql.SafePartial<Scheme>[]
150150
if (data) {
151-
has = _.some(this.cachesFields, i => !!(data as any)[i])
151+
has = _.some(this.cachesFields, i => (data as any)[i] !== undefined)
152152
resultList.push(data)
153153
}
154154
if (has) {

yarn.lock

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33

44

55
"@types/ioredis@^4.22.0":
6-
version "4.22.1"
7-
resolved "https://registry.npmjs.org/@types/ioredis/-/ioredis-4.22.1.tgz#e03b064189ab20c9edc95ccde6228d2bf81f538c"
8-
integrity sha512-GxXT828fkvBeThO68ZJg8cD2haqea5ANBJaxA+UZqLranNkEnQ8N7QLPtykwWbN/sRQz75O7kj+PNmCKF4CEKw==
6+
version "4.22.3"
7+
resolved "https://registry.npmjs.org/@types/ioredis/-/ioredis-4.22.3.tgz#72762efa0374c4a2e879ef697c6c3e4a47f9d641"
8+
integrity sha512-V23g0XZUmkm0Hp/GsQYV5Wz12ynm6h6lyi5v/o63iyqFV7+8t3k5YxCnFWVWFEjO6mvRI7V6f7YxNVxIjPsSUw==
99
dependencies:
1010
"@types/node" "*"
1111

@@ -14,10 +14,10 @@
1414
resolved "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.168.tgz#fe24632e79b7ade3f132891afff86caa5e5ce008"
1515
integrity sha512-oVfRvqHV/V6D1yifJbVRU3TMp8OT6o6BG+U9MkwuJ3U8/CsDHvalRpsxBqivn71ztOFZBTfJMvETbqHiaNSj7Q==
1616

17-
"@types/node@*", "@types/node@^14.14.35":
18-
version "14.14.35"
19-
resolved "https://registry.npmjs.org/@types/node/-/node-14.14.35.tgz#42c953a4e2b18ab931f72477e7012172f4ffa313"
20-
integrity sha512-Lt+wj8NVPx0zUmUwumiVXapmaLUcAk3yPuHCFVXras9k5VT9TdhJqKqGVUQCD60OTMCl0qxJ57OiTL0Mic3Iag==
17+
"@types/node@*", "@types/node@^14.14.37":
18+
version "14.14.37"
19+
resolved "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz#a3dd8da4eb84a996c36e331df98d82abd76b516e"
20+
integrity sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==
2121

2222
arr-diff@^4.0.0:
2323
version "4.0.0"
@@ -473,9 +473,9 @@ interpret@^2.2.0:
473473
integrity sha512-Ju0Bz/cEia55xDwUWEa8+olFpCiQoypjnQySseKtmjNrnps3P+xfpUmGr90T7yjlVJmOtybRvPXhKMbHr+fWnw==
474474

475475
ioredis@^4.24.2:
476-
version "4.24.4"
477-
resolved "https://registry.npmjs.org/ioredis/-/ioredis-4.24.4.tgz#2f3cc03c5bfc75e13141459418bb1bd64ba1c7cf"
478-
integrity sha512-v28xxBENyTmReC6lVTL7EkAPjVF8cuGtDEjGDi1Z2n7htsC2WdiDceZrCIPeuPiLa6kDFWHb1Y8O0upZROsMgA==
476+
version "4.25.0"
477+
resolved "https://registry.npmjs.org/ioredis/-/ioredis-4.25.0.tgz#bc78d1fcda9d2b6f120f47c5764672734810b369"
478+
integrity sha512-UoeqXpZB05aerGD3gB9NiigMsAyph+N+GWH8+3lX1+26caVV03GkL6JoLxS2HCxyvqCWbNsVSZTAp5W12qe23A==
479479
dependencies:
480480
cluster-key-slot "^1.1.0"
481481
debug "^4.3.1"
@@ -930,9 +930,9 @@ regex-not@^1.0.0, regex-not@^1.0.2:
930930
safe-regex "^1.1.0"
931931

932932
repeat-element@^1.1.2:
933-
version "1.1.3"
934-
resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce"
935-
integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==
933+
version "1.1.4"
934+
resolved "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.4.tgz#be681520847ab58c7568ac75fbfad28ed42d39e9"
935+
integrity sha512-LFiNfRcSu7KK3evMyYOuCzv3L10TW7yC1G2/+StMjK8Y6Vqd2MG7r/Qjw4ghtuCOjFvlnms/iMmLqpvW/ES/WQ==
936936

937937
repeat-string@^1.6.1:
938938
version "1.6.1"
@@ -1105,10 +1105,10 @@ to-regex@^3.0.1, to-regex@^3.0.2:
11051105
regex-not "^1.0.2"
11061106
safe-regex "^1.1.0"
11071107

1108-
typescript@^4.2.3:
1109-
version "4.2.3"
1110-
resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3"
1111-
integrity sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw==
1108+
typescript@^4.2.4:
1109+
version "4.2.4"
1110+
resolved "https://registry.npmjs.org/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961"
1111+
integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg==
11121112

11131113
unc-path-regex@^0.1.2:
11141114
version "0.1.2"

0 commit comments

Comments
 (0)