Socket
Socket
Sign inDemoInstall

@aomex/cache

Package Overview
Dependencies
Maintainers
0
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aomex/cache - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [2.0.2](https://github.com/aomex/aomex/compare/v2.0.1...v2.0.2) (2024-07-27)
**Note:** Version bump only for package @aomex/cache
## [2.0.1](https://github.com/aomex/aomex/compare/v2.0.0...v2.0.1) (2024-07-26)

@@ -8,0 +16,0 @@

38

dist/index.d.ts

@@ -71,7 +71,4 @@ import { I18nMessage } from '@aomex/core';

* ```typescript
* await cache.exists('key'); // false
* await cache.setNX('key', 'value'); // true
*
* await cache.exists('key'); // true
* await cache.setNX('key', 'value'); // false
* await cache.setNX('foo', 'bar'); // true
* await cache.setNX('foo', 'baz'); // false
* ```

@@ -83,3 +80,6 @@ */

*
* 假设当前一个列表 foo=[s],执行 `leftPush('foo', a, b, c)` 后列表 foo=[a, b, c, s]
* ```typescript
* await cache.leftPush('foo', 'a'); // ['a']
* await cache.leftPush('foo', 'b', 'c'); // ['b', 'c', 'a']
* ```
*/

@@ -92,7 +92,9 @@ leftPush(key: string, ...values: Caching.Types[]): Promise<boolean>;

/**
* 将key中储存的数字值增一。
* 将key中储存的数字值增一。如果key不存在,那么key的值会先被初始化为0,然后再执行操作。如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。
*
* 如果key不存在,那么key的值会先被初始化为0,然后再执行操作。
*
* 如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。
* ```typescript
* await cache.increment('foo'); // 1
* await cache.increment('foo'); // 2
* await cache.increment('foo'); // 3
* ```
*/

@@ -109,10 +111,14 @@ increment(key: string): Promise<number>;

* - 已设置过期时间则返回剩余时间,单位**毫秒**
*
* ```typescript
* await cache.ttl('foo'); // -2
* await cache.set('foo', 'bar');
* await cache.ttl('foo'); // -1
* await cache.expire('foo', 60000);
* await cache.ttl('foo'); // 59000
* ```
*/
ttl(key: string): Promise<number>;
/**
* 将key中储存的数字值减一。
*
* 如果key不存在,那么key的值会先被初始化为0,然后再执行操作。
*
* 如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。
* 将key中储存的数字值减一。如果key不存在,那么key的值会先被初始化为0,然后再执行操作。如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误
*/

@@ -125,3 +131,3 @@ decrement(key: string): Promise<number>;

/**
* 删除所有缓存。若指定了keyPrefix,则只删除有该前缀的缓存
* 删除所有缓存
*/

@@ -128,0 +134,0 @@ deleteAll(): Promise<boolean>;

@@ -66,7 +66,4 @@ // src/i18n/locales/en-us.ts

* ```typescript
* await cache.exists('key'); // false
* await cache.setNX('key', 'value'); // true
*
* await cache.exists('key'); // true
* await cache.setNX('key', 'value'); // false
* await cache.setNX('foo', 'bar'); // true
* await cache.setNX('foo', 'baz'); // false
* ```

@@ -83,3 +80,6 @@ */

*
* 假设当前一个列表 foo=[s],执行 `leftPush('foo', a, b, c)` 后列表 foo=[a, b, c, s]
* ```typescript
* await cache.leftPush('foo', 'a'); // ['a']
* await cache.leftPush('foo', 'b', 'c'); // ['b', 'c', 'a']
* ```
*/

@@ -105,7 +105,9 @@ async leftPush(key, ...values) {

/**
* 将key中储存的数字值增一。
* 将key中储存的数字值增一。如果key不存在,那么key的值会先被初始化为0,然后再执行操作。如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。
*
* 如果key不存在,那么key的值会先被初始化为0,然后再执行操作。
*
* 如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。
* ```typescript
* await cache.increment('foo'); // 1
* await cache.increment('foo'); // 2
* await cache.increment('foo'); // 3
* ```
*/

@@ -130,2 +132,10 @@ async increment(key) {

* - 已设置过期时间则返回剩余时间,单位**毫秒**
*
* ```typescript
* await cache.ttl('foo'); // -2
* await cache.set('foo', 'bar');
* await cache.ttl('foo'); // -1
* await cache.expire('foo', 60000);
* await cache.ttl('foo'); // 59000
* ```
*/

@@ -138,7 +148,3 @@ async ttl(key) {

/**
* 将key中储存的数字值减一。
*
* 如果key不存在,那么key的值会先被初始化为0,然后再执行操作。
*
* 如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误。
* 将key中储存的数字值减一。如果key不存在,那么key的值会先被初始化为0,然后再执行操作。如果值包含错误的类型,或字符串类型的值不能表示为数字,那么返回一个错误
*/

@@ -159,3 +165,3 @@ async decrement(key) {

/**
* 删除所有缓存。若指定了keyPrefix,则只删除有该前缀的缓存
* 删除所有缓存
*/

@@ -162,0 +168,0 @@ async deleteAll() {

{
"name": "@aomex/cache",
"version": "2.0.1",
"version": "2.0.2",
"description": "缓存基础类",

@@ -34,6 +34,6 @@ "type": "module",

"devDependencies": {
"@aomex/core": "^2.0.1",
"@aomex/internal-tools": "^2.0.1"
"@aomex/core": "^2.0.2",
"@aomex/internal-tools": "^2.0.2"
},
"scripts": {}
}

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc