@aomex/core
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -6,2 +6,10 @@ # Change Log | ||
# [1.4.0](https://github.com/aomex/aomex/compare/v1.3.0...v1.4.0) (2024-06-29) | ||
**Note:** Version bump only for package @aomex/core | ||
# [1.3.0](https://github.com/aomex/aomex/compare/v1.2.0...v1.3.0) (2024-06-28) | ||
@@ -8,0 +16,0 @@ |
{ | ||
"name": "@aomex/core", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "aomex核心库", | ||
@@ -39,5 +39,5 @@ "type": "module", | ||
"openapi-types": "^12.1.3", | ||
"@aomex/internal-tools": "^1.3.0" | ||
"@aomex/internal-tools": "^1.4.0" | ||
}, | ||
"scripts": {} | ||
} |
# @aomex/core | ||
aomex核心应用 | ||
## middleware | ||
中间件,上层应用可扩展 | ||
```typescript | ||
import { middleware } from '@aomex/core'; | ||
export const md = middleware.mixin(async (ctx, next) => { | ||
// ... | ||
return next(); | ||
}); | ||
``` | ||
## validator | ||
验证器,验证一切输入 | ||
```typescript | ||
import { rules, validate } from '@aomex/core'; | ||
const untrusted = { | ||
id: '1', | ||
name: 'aomex', | ||
eval: 'delete table', | ||
}; | ||
const trusted = await validate(untrusted, { | ||
id: rule.int(), | ||
name: rule.string(), | ||
}); | ||
console.log(trusted); // { id: 1, name: 'aomex' } | ||
``` | ||
文档:https://aomex.js.org |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
199544
4
Updated@aomex/internal-tools@^1.4.0