decoverto:使用@decorators在JSON与ES类之间进行转换

时间:2021-03-30 22:49:18
【文件属性】:
文件名称:decoverto:使用@decorators在JSON与ES类之间进行转换
文件大小:198KB
文件格式:ZIP
更新时间:2021-03-30 22:49:18
serialization json typescript parse decorators 揭秘 使用装饰器将JSON之类的数据转换为类并返回。 使用简单易用的修饰符为数据类添加注释,然后将标准JSON解析为实际的类实例。 为了获得更多的类型安全性和更少的语法,建议与一起使用, 是用于装饰器元数据的ES7 Reflection API的原型。 通过无缝集成到现有代码中,超轻量级语法 安全地将标准JSON解析为类实例,而无需在源JSON中指定任何类型信息 安装 使用以下方法安装: yarn add decoverto 或者 npm install decoverto 可选:安装以获得附加的类型安全性和减少的语法要求。 reflect-metadata必须全局可用才能工作。 通常可以使用import 'reflect-metadata'完成此操作。 如何使用 Decoverto使用的装饰,并要求你的类与被注解@model ,并与性能@property 。 未注释的属性将不会序
【文件预览】:
decoverto-master
----.gitignore(265B)
----codecov.yml(163B)
----ava.no-reflect-metadata.config.js(341B)
----package.json(3KB)
----src()
--------parser.ts(2KB)
--------inherits.decorator.ts(3KB)
--------type-handler.ts(6KB)
--------property.decorator.ts(4KB)
--------decoverto.ts(3KB)
--------errors()
--------util()
--------diagnostics.ts(6KB)
--------index.ts(582B)
--------model.decorator.ts(2KB)
--------helpers.ts(375B)
--------types.ts(213B)
--------converters()
--------metadata.ts(5KB)
----.eslintrc.yaml(1KB)
----ava.no-emit-decorator-metadata.config.js(376B)
----LICENSE(1KB)
----tsconfig.json(791B)
----.github()
--------workflows()
----tools()
--------diagnostics.spec.ts(1KB)
--------benchmark()
--------tsconfig.tools.json(207B)
----ava.default.config.js(357B)
----lint-staged.config.js(373B)
----spec()
--------no-emit-decorator-metadata()
--------helpers()
--------utils()
--------no-reflect-metadata()
--------default()
----README.md(9KB)
----tsconfig()
--------tsconfig.app-base.json(90B)
--------tsconfig.spec-strict.json(155B)
--------tsconfig.lint.json(146B)
--------tsconfig.bundle.esm5.json(194B)
--------tsconfig.spec.json(226B)
--------tsconfig.app.json(101B)
--------README.md(2KB)
--------tsconfig.bundle.types.json(308B)
--------tsconfig.bundle.cjs.json(164B)
--------tsconfig.app-strict.json(104B)
--------tsconfig.base.json(446B)
--------tsconfig.bundle.esm.json(196B)
----nyc.config.js(164B)
----.gitattributes(2KB)
----.editorconfig(278B)
----yarn.lock(310KB)

网友评论