@aomex/core
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@aomex/core

aomex核心应用

middleware

中间件,上层应用可扩展

import { middleware } from '@aomex/core';

export const md = middleware.mixin(async (ctx, next) => {
  // ...
  return next();
});

middleware-chain

中间件组,上层应用可扩展

import { mdchain } from '@aomex/core';

export const box = mdchain.mixin.mount(md);

validator

验证器,验证一切输入

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' }

Readme

Keywords

none

Package Sidebar

Install

npm i @aomex/core

Homepage

aomex.js.org

Weekly Downloads

21

Version

1.0.2

License

MIT

Unpacked Size

203 kB

Total Files

7

Last publish

Collaborators

  • fwh1990