koatty_store 1.6.1 → 1.6.2
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/.rollup.config.js +62 -62
- package/.vscode/launch.json +25 -0
- package/CHANGELOG.md +20 -18
- package/LICENSE +29 -29
- package/README.md +2 -2
- package/dist/LICENSE +29 -29
- package/dist/README.md +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +12 -12
- package/dist/index.mjs +12 -12
- package/dist/package.json +99 -95
- package/package.json +99 -95
package/.rollup.config.js
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Description:
|
|
3
|
-
* @Usage:
|
|
4
|
-
* @Author: richen
|
|
5
|
-
* @Date: 2021-12-17 10:20:44
|
|
6
|
-
* @LastEditTime: 2023-02-18 23:21:06
|
|
7
|
-
*/
|
|
8
|
-
import json from "@rollup/plugin-json";
|
|
9
|
-
import typescript from 'rollup-plugin-typescript2';
|
|
10
|
-
// import babel from '@rollup/plugin-babel';
|
|
11
|
-
|
|
12
|
-
export default [
|
|
13
|
-
{
|
|
14
|
-
input: './src/index.ts',
|
|
15
|
-
output: [{
|
|
16
|
-
format: 'cjs',
|
|
17
|
-
file: './dist/index.js',
|
|
18
|
-
banner: require('./scripts/copyright')
|
|
19
|
-
}],
|
|
20
|
-
plugins: [
|
|
21
|
-
// babel({
|
|
22
|
-
// babelHelpers: "runtime",
|
|
23
|
-
// configFile: './babel.config.js',
|
|
24
|
-
// exclude: 'node_modules/**',
|
|
25
|
-
// }),
|
|
26
|
-
json(),
|
|
27
|
-
typescript({
|
|
28
|
-
tsconfigOverride: {
|
|
29
|
-
compilerOptions: {
|
|
30
|
-
declaration: false,
|
|
31
|
-
declarationMap: false,
|
|
32
|
-
module: "ESNext"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
})
|
|
36
|
-
]
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
input: './src/index.ts',
|
|
40
|
-
output: [{
|
|
41
|
-
format: 'es',
|
|
42
|
-
file: './dist/index.mjs',
|
|
43
|
-
banner: require('./scripts/copyright')
|
|
44
|
-
}],
|
|
45
|
-
plugins: [
|
|
46
|
-
// babel({
|
|
47
|
-
// babelHelpers: "runtime",
|
|
48
|
-
// configFile: './babel.config.js',
|
|
49
|
-
// exclude: 'node_modules/**',
|
|
50
|
-
// }),
|
|
51
|
-
json(),
|
|
52
|
-
typescript({
|
|
53
|
-
tsconfigOverride: {
|
|
54
|
-
compilerOptions: {
|
|
55
|
-
declaration: false,
|
|
56
|
-
declarationMap: false,
|
|
57
|
-
module: "ESNext"
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
})
|
|
61
|
-
]
|
|
62
|
-
}
|
|
1
|
+
/*
|
|
2
|
+
* @Description:
|
|
3
|
+
* @Usage:
|
|
4
|
+
* @Author: richen
|
|
5
|
+
* @Date: 2021-12-17 10:20:44
|
|
6
|
+
* @LastEditTime: 2023-02-18 23:21:06
|
|
7
|
+
*/
|
|
8
|
+
import json from "@rollup/plugin-json";
|
|
9
|
+
import typescript from 'rollup-plugin-typescript2';
|
|
10
|
+
// import babel from '@rollup/plugin-babel';
|
|
11
|
+
|
|
12
|
+
export default [
|
|
13
|
+
{
|
|
14
|
+
input: './src/index.ts',
|
|
15
|
+
output: [{
|
|
16
|
+
format: 'cjs',
|
|
17
|
+
file: './dist/index.js',
|
|
18
|
+
banner: require('./scripts/copyright')
|
|
19
|
+
}],
|
|
20
|
+
plugins: [
|
|
21
|
+
// babel({
|
|
22
|
+
// babelHelpers: "runtime",
|
|
23
|
+
// configFile: './babel.config.js',
|
|
24
|
+
// exclude: 'node_modules/**',
|
|
25
|
+
// }),
|
|
26
|
+
json(),
|
|
27
|
+
typescript({
|
|
28
|
+
tsconfigOverride: {
|
|
29
|
+
compilerOptions: {
|
|
30
|
+
declaration: false,
|
|
31
|
+
declarationMap: false,
|
|
32
|
+
module: "ESNext"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
})
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
input: './src/index.ts',
|
|
40
|
+
output: [{
|
|
41
|
+
format: 'es',
|
|
42
|
+
file: './dist/index.mjs',
|
|
43
|
+
banner: require('./scripts/copyright')
|
|
44
|
+
}],
|
|
45
|
+
plugins: [
|
|
46
|
+
// babel({
|
|
47
|
+
// babelHelpers: "runtime",
|
|
48
|
+
// configFile: './babel.config.js',
|
|
49
|
+
// exclude: 'node_modules/**',
|
|
50
|
+
// }),
|
|
51
|
+
json(),
|
|
52
|
+
typescript({
|
|
53
|
+
tsconfigOverride: {
|
|
54
|
+
compilerOptions: {
|
|
55
|
+
declaration: false,
|
|
56
|
+
declarationMap: false,
|
|
57
|
+
module: "ESNext"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
})
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
63
|
]
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
// 使用 IntelliSense 了解相关属性。
|
|
3
|
+
// 悬停以查看现有属性的描述。
|
|
4
|
+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "Launch Typescript Project",
|
|
9
|
+
"type": "node",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"args": [
|
|
12
|
+
"${workspaceRoot}/test/test.ts"
|
|
13
|
+
],
|
|
14
|
+
"runtimeArgs": [
|
|
15
|
+
"--nolazy",
|
|
16
|
+
"-r",
|
|
17
|
+
"ts-node/register"
|
|
18
|
+
],
|
|
19
|
+
"sourceMaps": true,
|
|
20
|
+
"cwd": "${workspaceRoot}",
|
|
21
|
+
"protocol": "inspector",
|
|
22
|
+
"internalConsoleOptions": "neverOpen"
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.6.2](https://github.com/koatty/koatty_store/compare/v1.6.1...v1.6.2) (2023-12-20)
|
|
6
|
+
|
|
5
7
|
### [1.6.1](https://github.com/koatty/koatty_store/compare/v1.6.0...v1.6.1) (2023-07-28)
|
|
6
8
|
|
|
7
9
|
|
|
@@ -9,21 +11,21 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
9
11
|
|
|
10
12
|
* remove words ([604d31d](https://github.com/koatty/koatty_store/commit/604d31df38814a530b32605668542821b608cb7d))
|
|
11
13
|
|
|
12
|
-
## [1.6.0](https://github.com/koatty/koatty_store/compare/v1.5.8...v1.6.0) (2023-02-18)
|
|
13
|
-
|
|
14
|
-
### [1.5.8](https://github.com/koatty/koatty_store/compare/v1.5.6...v1.5.8) (2023-01-13)
|
|
15
|
-
|
|
16
|
-
### [1.5.6](https://github.com/koatty/koatty_store/compare/v1.5.5...v1.5.6) (2022-11-03)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
### Bug Fixes
|
|
20
|
-
|
|
21
|
-
* upgrade deps ([cf54da2](https://github.com/koatty/koatty_store/commit/cf54da2c9e13ba843efa44b4631f3144946ebdff))
|
|
22
|
-
|
|
23
|
-
### [1.5.5](https://github.com/koatty/koatty_store/compare/v1.5.4...v1.5.5) (2022-05-27)
|
|
24
|
-
|
|
25
|
-
### [1.5.4](https://github.com/koatty/koatty_store/compare/v1.5.2...v1.5.4) (2021-12-02)
|
|
26
|
-
|
|
27
|
-
### [1.5.2](https://github.com/koatty/koatty_store/compare/v1.4.10...v1.5.2) (2021-12-02)
|
|
28
|
-
|
|
29
|
-
### [1.4.10](https://github.com/koatty/koatty_store/compare/v1.4.8...v1.4.10) (2021-11-20)
|
|
14
|
+
## [1.6.0](https://github.com/koatty/koatty_store/compare/v1.5.8...v1.6.0) (2023-02-18)
|
|
15
|
+
|
|
16
|
+
### [1.5.8](https://github.com/koatty/koatty_store/compare/v1.5.6...v1.5.8) (2023-01-13)
|
|
17
|
+
|
|
18
|
+
### [1.5.6](https://github.com/koatty/koatty_store/compare/v1.5.5...v1.5.6) (2022-11-03)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* upgrade deps ([cf54da2](https://github.com/koatty/koatty_store/commit/cf54da2c9e13ba843efa44b4631f3144946ebdff))
|
|
24
|
+
|
|
25
|
+
### [1.5.5](https://github.com/koatty/koatty_store/compare/v1.5.4...v1.5.5) (2022-05-27)
|
|
26
|
+
|
|
27
|
+
### [1.5.4](https://github.com/koatty/koatty_store/compare/v1.5.2...v1.5.4) (2021-12-02)
|
|
28
|
+
|
|
29
|
+
### [1.5.2](https://github.com/koatty/koatty_store/compare/v1.4.10...v1.5.2) (2021-12-02)
|
|
30
|
+
|
|
31
|
+
### [1.4.10](https://github.com/koatty/koatty_store/compare/v1.4.8...v1.4.10) (2021-11-20)
|
package/LICENSE
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
BSD 3-Clause License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020, Koatty
|
|
4
|
-
All rights reserved.
|
|
5
|
-
|
|
6
|
-
Redistribution and use in source and binary forms, with or without
|
|
7
|
-
modification, are permitted provided that the following conditions are met:
|
|
8
|
-
|
|
9
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
-
list of conditions and the following disclaimer.
|
|
11
|
-
|
|
12
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
-
this list of conditions and the following disclaimer in the documentation
|
|
14
|
-
and/or other materials provided with the distribution.
|
|
15
|
-
|
|
16
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
-
contributors may be used to endorse or promote products derived from
|
|
18
|
-
this software without specific prior written permission.
|
|
19
|
-
|
|
20
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020, Koatty
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# koatty_store
|
|
2
|
-
Cache store (memory or reids) for koatty.
|
|
1
|
+
# koatty_store
|
|
2
|
+
Cache store (memory or reids) for koatty.
|
package/dist/LICENSE
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
BSD 3-Clause License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020, Koatty
|
|
4
|
-
All rights reserved.
|
|
5
|
-
|
|
6
|
-
Redistribution and use in source and binary forms, with or without
|
|
7
|
-
modification, are permitted provided that the following conditions are met:
|
|
8
|
-
|
|
9
|
-
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
-
list of conditions and the following disclaimer.
|
|
11
|
-
|
|
12
|
-
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
-
this list of conditions and the following disclaimer in the documentation
|
|
14
|
-
and/or other materials provided with the distribution.
|
|
15
|
-
|
|
16
|
-
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
-
contributors may be used to endorse or promote products derived from
|
|
18
|
-
this software without specific prior written permission.
|
|
19
|
-
|
|
20
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
-
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
-
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
-
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
-
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
-
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
-
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020, Koatty
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/dist/README.md
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
# koatty_store
|
|
2
|
-
Cache store (memory or reids) for koatty.
|
|
1
|
+
# koatty_store
|
|
2
|
+
Cache store (memory or reids) for koatty.
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @Author: richen
|
|
3
|
-
* @Date: 2023-
|
|
3
|
+
* @Date: 2023-12-20 19:11:59
|
|
4
4
|
* @License: BSD (3-Clause)
|
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
|
6
6
|
* @HomePage: https://koatty.org/
|
|
@@ -38,7 +38,7 @@ var helper__namespace = /*#__PURE__*/_interopNamespaceDefault(helper);
|
|
|
38
38
|
* @Usage:
|
|
39
39
|
* @Author: richen
|
|
40
40
|
* @Date: 2021-12-02 11:03:20
|
|
41
|
-
* @LastEditTime: 2023-
|
|
41
|
+
* @LastEditTime: 2023-12-20 19:04:29
|
|
42
42
|
*/
|
|
43
43
|
/**
|
|
44
44
|
*
|
|
@@ -1457,16 +1457,16 @@ class RedisStore {
|
|
|
1457
1457
|
try {
|
|
1458
1458
|
conn = await this.defineCommand("getCompare", {
|
|
1459
1459
|
numberOfKeys: 1,
|
|
1460
|
-
lua: `
|
|
1461
|
-
local remote_value = redis.call("get",KEYS[1])
|
|
1462
|
-
|
|
1463
|
-
if (not remote_value) then
|
|
1464
|
-
return 0
|
|
1465
|
-
elseif (remote_value == ARGV[1]) then
|
|
1466
|
-
return redis.call("del",KEYS[1])
|
|
1467
|
-
else
|
|
1468
|
-
return -1
|
|
1469
|
-
end
|
|
1460
|
+
lua: `
|
|
1461
|
+
local remote_value = redis.call("get",KEYS[1])
|
|
1462
|
+
|
|
1463
|
+
if (not remote_value) then
|
|
1464
|
+
return 0
|
|
1465
|
+
elseif (remote_value == ARGV[1]) then
|
|
1466
|
+
return redis.call("del",KEYS[1])
|
|
1467
|
+
else
|
|
1468
|
+
return -1
|
|
1469
|
+
end
|
|
1470
1470
|
`
|
|
1471
1471
|
});
|
|
1472
1472
|
return conn.getCompare(name, value);
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @Author: richen
|
|
3
|
-
* @Date: 2023-
|
|
3
|
+
* @Date: 2023-12-20 19:11:59
|
|
4
4
|
* @License: BSD (3-Clause)
|
|
5
5
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
|
6
6
|
* @HomePage: https://koatty.org/
|
|
@@ -17,7 +17,7 @@ import genericPool from 'generic-pool';
|
|
|
17
17
|
* @Usage:
|
|
18
18
|
* @Author: richen
|
|
19
19
|
* @Date: 2021-12-02 11:03:20
|
|
20
|
-
* @LastEditTime: 2023-
|
|
20
|
+
* @LastEditTime: 2023-12-20 19:04:29
|
|
21
21
|
*/
|
|
22
22
|
/**
|
|
23
23
|
*
|
|
@@ -1436,16 +1436,16 @@ class RedisStore {
|
|
|
1436
1436
|
try {
|
|
1437
1437
|
conn = await this.defineCommand("getCompare", {
|
|
1438
1438
|
numberOfKeys: 1,
|
|
1439
|
-
lua: `
|
|
1440
|
-
local remote_value = redis.call("get",KEYS[1])
|
|
1441
|
-
|
|
1442
|
-
if (not remote_value) then
|
|
1443
|
-
return 0
|
|
1444
|
-
elseif (remote_value == ARGV[1]) then
|
|
1445
|
-
return redis.call("del",KEYS[1])
|
|
1446
|
-
else
|
|
1447
|
-
return -1
|
|
1448
|
-
end
|
|
1439
|
+
lua: `
|
|
1440
|
+
local remote_value = redis.call("get",KEYS[1])
|
|
1441
|
+
|
|
1442
|
+
if (not remote_value) then
|
|
1443
|
+
return 0
|
|
1444
|
+
elseif (remote_value == ARGV[1]) then
|
|
1445
|
+
return redis.call("del",KEYS[1])
|
|
1446
|
+
else
|
|
1447
|
+
return -1
|
|
1448
|
+
end
|
|
1449
1449
|
`
|
|
1450
1450
|
});
|
|
1451
1451
|
return conn.getCompare(name, value);
|
package/dist/package.json
CHANGED
|
@@ -1,95 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "koatty_store",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "Cache store for koatty.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
|
-
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
|
8
|
-
"build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
|
-
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
-
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
|
11
|
-
"eslint": "eslint --ext .ts,.js ./",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"release
|
|
17
|
-
"release:
|
|
18
|
-
"release:
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"@commitlint/
|
|
62
|
-
"@
|
|
63
|
-
"@microsoft/api-
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"jest": "^
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
}
|
|
95
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "koatty_store",
|
|
3
|
+
"version": "1.6.2",
|
|
4
|
+
"description": "Cache store for koatty.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
|
+
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
|
8
|
+
"build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
|
+
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
+
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
|
11
|
+
"eslint": "eslint --ext .ts,.js ./",
|
|
12
|
+
"lock": "npm i --package-lock-only",
|
|
13
|
+
"prepublishOnly": "npm test && npm run build",
|
|
14
|
+
"prerelease": "npm test && npm run build",
|
|
15
|
+
"pub": "git push --follow-tags origin && npm publish",
|
|
16
|
+
"release": "standard-version",
|
|
17
|
+
"release:pre": "npm run release -- --prerelease",
|
|
18
|
+
"release:major": "npm run release -- --release-as major",
|
|
19
|
+
"release:minor": "npm run release -- --release-as minor",
|
|
20
|
+
"test": "npm run eslint && jest --passWithNoTests"
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"import": "./dist/index.mjs"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/koatty/koatty_store.git"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"web",
|
|
33
|
+
"typescript",
|
|
34
|
+
"framework",
|
|
35
|
+
"mvc",
|
|
36
|
+
"koa2",
|
|
37
|
+
"restful",
|
|
38
|
+
"agile",
|
|
39
|
+
"koatty_store",
|
|
40
|
+
"koatty"
|
|
41
|
+
],
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">10.0.0"
|
|
44
|
+
},
|
|
45
|
+
"author": {
|
|
46
|
+
"name": "richenlin",
|
|
47
|
+
"email": "richenlin@gmail.com"
|
|
48
|
+
},
|
|
49
|
+
"license": "BSD-3-Clause",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/koatty/koatty_store/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/koatty/koatty_store",
|
|
54
|
+
"maintainers": [
|
|
55
|
+
{
|
|
56
|
+
"name": "richenlin",
|
|
57
|
+
"email": "richenlin@gmail.com"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@commitlint/cli": "^17.x.x",
|
|
62
|
+
"@commitlint/config-conventional": "^17.x.x",
|
|
63
|
+
"@microsoft/api-documenter": "^7.x.x",
|
|
64
|
+
"@microsoft/api-extractor": "^7.x.x",
|
|
65
|
+
"@rollup/plugin-json": "^6.x.x",
|
|
66
|
+
"@types/jest": "^29.x.x",
|
|
67
|
+
"@types/koa": "^2.x.x",
|
|
68
|
+
"@types/lodash": "^4.x.x",
|
|
69
|
+
"@types/node": "^18.x.x",
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^5.x.x",
|
|
71
|
+
"@typescript-eslint/parser": "^5.x.x",
|
|
72
|
+
"conventional-changelog-cli": "^2.x.x",
|
|
73
|
+
"copyfiles": "^2.x.x",
|
|
74
|
+
"del-cli": "^4.x.x",
|
|
75
|
+
"eslint": "^8.x.x",
|
|
76
|
+
"eslint-plugin-jest": "^27.x.x",
|
|
77
|
+
"husky": "^4.x.x",
|
|
78
|
+
"jest": "^29.x.x",
|
|
79
|
+
"jest-html-reporters": "^3.x.x",
|
|
80
|
+
"rollup": "^3.x.x",
|
|
81
|
+
"rollup-plugin-typescript2": "^0.x.x",
|
|
82
|
+
"standard-version": "^9.x.x",
|
|
83
|
+
"ts-jest": "^29.x.x",
|
|
84
|
+
"ts-node": "^10.x.x",
|
|
85
|
+
"tslib": "^2.x.x",
|
|
86
|
+
"typescript": "^4.x.x"
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"generic-pool": "^3.9.0",
|
|
90
|
+
"ioredis": "^5.3.2",
|
|
91
|
+
"koatty_lib": "^1.x.x",
|
|
92
|
+
"koatty_logger": "^2.x.x",
|
|
93
|
+
"lodash": "^4.17.21"
|
|
94
|
+
},
|
|
95
|
+
"peerDependencies": {
|
|
96
|
+
"koatty_lib": "^1.x.x",
|
|
97
|
+
"koatty_logger": "^2.x.x"
|
|
98
|
+
}
|
|
99
|
+
}
|
package/package.json
CHANGED
|
@@ -1,95 +1,99 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "koatty_store",
|
|
3
|
-
"version": "1.6.
|
|
4
|
-
"description": "Cache store for koatty.",
|
|
5
|
-
"scripts": {
|
|
6
|
-
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
|
-
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
|
8
|
-
"build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
|
-
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
-
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
|
11
|
-
"eslint": "eslint --ext .ts,.js ./",
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"release
|
|
17
|
-
"release:
|
|
18
|
-
"release:
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"@commitlint/
|
|
62
|
-
"@
|
|
63
|
-
"@microsoft/api-
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/
|
|
68
|
-
"@
|
|
69
|
-
"@
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"jest": "^
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
"
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
}
|
|
95
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "koatty_store",
|
|
3
|
+
"version": "1.6.2",
|
|
4
|
+
"description": "Cache store for koatty.",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "npm run build:js && npm run build:dts && npm run build:doc && npm run build:cp",
|
|
7
|
+
"build:cp": "node scripts/postBuild && copyfiles package.json LICENSE README.md dist/",
|
|
8
|
+
"build:js": "del-cli --force dist && npx rollup --bundleConfigAsCjs -c .rollup.config.js",
|
|
9
|
+
"build:doc": "del-cli --force docs/api && npx api-documenter markdown --input temp --output docs/api",
|
|
10
|
+
"build:dts": "del-cli --force temp && npx tsc && npx api-extractor run --local --verbose",
|
|
11
|
+
"eslint": "eslint --ext .ts,.js ./",
|
|
12
|
+
"lock": "npm i --package-lock-only",
|
|
13
|
+
"prepublishOnly": "npm test && npm run build",
|
|
14
|
+
"prerelease": "npm test && npm run build",
|
|
15
|
+
"pub": "git push --follow-tags origin && npm publish",
|
|
16
|
+
"release": "standard-version",
|
|
17
|
+
"release:pre": "npm run release -- --prerelease",
|
|
18
|
+
"release:major": "npm run release -- --release-as major",
|
|
19
|
+
"release:minor": "npm run release -- --release-as minor",
|
|
20
|
+
"test": "npm run eslint && jest --passWithNoTests"
|
|
21
|
+
},
|
|
22
|
+
"main": "./dist/index.js",
|
|
23
|
+
"exports": {
|
|
24
|
+
"require": "./dist/index.js",
|
|
25
|
+
"import": "./dist/index.mjs"
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/koatty/koatty_store.git"
|
|
30
|
+
},
|
|
31
|
+
"keywords": [
|
|
32
|
+
"web",
|
|
33
|
+
"typescript",
|
|
34
|
+
"framework",
|
|
35
|
+
"mvc",
|
|
36
|
+
"koa2",
|
|
37
|
+
"restful",
|
|
38
|
+
"agile",
|
|
39
|
+
"koatty_store",
|
|
40
|
+
"koatty"
|
|
41
|
+
],
|
|
42
|
+
"engines": {
|
|
43
|
+
"node": ">10.0.0"
|
|
44
|
+
},
|
|
45
|
+
"author": {
|
|
46
|
+
"name": "richenlin",
|
|
47
|
+
"email": "richenlin@gmail.com"
|
|
48
|
+
},
|
|
49
|
+
"license": "BSD-3-Clause",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/koatty/koatty_store/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://github.com/koatty/koatty_store",
|
|
54
|
+
"maintainers": [
|
|
55
|
+
{
|
|
56
|
+
"name": "richenlin",
|
|
57
|
+
"email": "richenlin@gmail.com"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@commitlint/cli": "^17.x.x",
|
|
62
|
+
"@commitlint/config-conventional": "^17.x.x",
|
|
63
|
+
"@microsoft/api-documenter": "^7.x.x",
|
|
64
|
+
"@microsoft/api-extractor": "^7.x.x",
|
|
65
|
+
"@rollup/plugin-json": "^6.x.x",
|
|
66
|
+
"@types/jest": "^29.x.x",
|
|
67
|
+
"@types/koa": "^2.x.x",
|
|
68
|
+
"@types/lodash": "^4.x.x",
|
|
69
|
+
"@types/node": "^18.x.x",
|
|
70
|
+
"@typescript-eslint/eslint-plugin": "^5.x.x",
|
|
71
|
+
"@typescript-eslint/parser": "^5.x.x",
|
|
72
|
+
"conventional-changelog-cli": "^2.x.x",
|
|
73
|
+
"copyfiles": "^2.x.x",
|
|
74
|
+
"del-cli": "^4.x.x",
|
|
75
|
+
"eslint": "^8.x.x",
|
|
76
|
+
"eslint-plugin-jest": "^27.x.x",
|
|
77
|
+
"husky": "^4.x.x",
|
|
78
|
+
"jest": "^29.x.x",
|
|
79
|
+
"jest-html-reporters": "^3.x.x",
|
|
80
|
+
"rollup": "^3.x.x",
|
|
81
|
+
"rollup-plugin-typescript2": "^0.x.x",
|
|
82
|
+
"standard-version": "^9.x.x",
|
|
83
|
+
"ts-jest": "^29.x.x",
|
|
84
|
+
"ts-node": "^10.x.x",
|
|
85
|
+
"tslib": "^2.x.x",
|
|
86
|
+
"typescript": "^4.x.x"
|
|
87
|
+
},
|
|
88
|
+
"dependencies": {
|
|
89
|
+
"generic-pool": "^3.9.0",
|
|
90
|
+
"ioredis": "^5.3.2",
|
|
91
|
+
"koatty_lib": "^1.x.x",
|
|
92
|
+
"koatty_logger": "^2.x.x",
|
|
93
|
+
"lodash": "^4.17.21"
|
|
94
|
+
},
|
|
95
|
+
"peerDependencies": {
|
|
96
|
+
"koatty_lib": "^1.x.x",
|
|
97
|
+
"koatty_logger": "^2.x.x"
|
|
98
|
+
}
|
|
99
|
+
}
|