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 3.2.2 to 3.2.3

8

CHANGELOG.md

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

## [3.2.3](https://github.com/aomex/aomex/compare/v3.2.2...v3.2.3) (2024-09-25)
**Note:** Version bump only for package @aomex/cache
## [3.2.2](https://github.com/aomex/aomex/compare/v3.2.1...v3.2.2) (2024-09-19)

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

13

dist/index.d.ts

@@ -1,14 +0,1 @@

import { I18nMessage } from '@aomex/core';
declare module '@aomex/core' {
namespace I18n {
interface Definition {
cache: {
wrong_type: I18nMessage;
not_integer: I18nMessage;
};
}
}
}
declare abstract class CacheAdapter {

@@ -15,0 +2,0 @@ connect(): Promise<void>;

48

dist/index.js

@@ -1,15 +0,1 @@

// src/i18n/locales/en-us.ts
import { i18n } from "@aomex/core";
i18n.register("en_US", "cache", {
wrong_type: "wrong kind of value",
not_integer: "value is not an integer"
});
// src/i18n/locales/zh-cn.ts
import { i18n as i18n2 } from "@aomex/core";
i18n2.register("zh_CN", "cache", {
wrong_type: "\u9519\u8BEF\u7684\u503C\u7C7B\u578B",
not_integer: "\u503C\u4E0D\u662F\u6574\u6570\u7C7B\u578B"
});
// src/caching.ts

@@ -173,4 +159,32 @@ import { createHash } from "node:crypto";

// src/i18n/index.ts
import { I18n as I18n3 } from "@aomex/core";
// src/i18n/locales/zh-cn.ts
import { I18n } from "@aomex/core";
var zh = I18n.define({
wrong_type: "\u9519\u8BEF\u7684\u503C\u7C7B\u578B",
not_integer: "\u503C\u4E0D\u662F\u6574\u6570\u7C7B\u578B"
});
// src/i18n/locales/en-us.ts
import { I18n as I18n2 } from "@aomex/core";
var en = I18n2.satisfies(zh).define({
wrong_type: "wrong kind of value",
not_integer: "value is not an integer"
});
// src/i18n/locales/index.ts
var locales = {
zh_CN: zh,
en_US: en
};
// src/i18n/index.ts
var i18n = new I18n3({
locales,
defaultLanguage: "zh_CN"
});
// src/cache-memory-adapter.ts
import { i18n as i18n3 } from "@aomex/core";
var CacheMemoryAdapter = class extends CacheAdapter {

@@ -236,3 +250,3 @@ data = /* @__PURE__ */ new Map();

if (Number.isNaN(value) || !Number.isInteger(value)) {
throw new Error(i18n3.t("cache.not_integer"));
throw new Error(i18n.t("not_integer"));
}

@@ -282,3 +296,3 @@ this.setValueSync(key, String(--value));

if (!isValid) {
throw new Error(i18n3.t("cache.wrong_type"));
throw new Error(i18n.t("wrong_type"));
}

@@ -285,0 +299,0 @@ return value;

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

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

"devDependencies": {
"@aomex/core": "^3.2.2",
"@aomex/internal-tools": "^3.2.2"
"@aomex/core": "^3.2.3",
"@aomex/internal-tools": "^3.2.3"
},
"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