【文件属性】:
文件名称:json-type:从JSON字符串生成类型
文件大小:12KB
文件格式:ZIP
更新时间:2021-02-12 07:53:24
TypeScript
json类型
从JSON字符串生成类型。
安装
使用npm:
$ npm install @dqn/json-type
使用纱:
$ yarn add @dqn/json-type
例
import type { JsonType } from "@dqn/json-type" ;
type Obj = JsonType < '{ "foo": "aaa", "bar": 12, "piyo": { "nyaa": [null, true] } }' > ;
// type Obj = {
// foo: "aaa";
// bar: 12;
// piyo: {
// nyaa: [null, true];
// };
// };
执照
麻省理工学院
【文件预览】:
json-type-main
----.github()
--------workflows()
----yarn.lock(872B)
----src()
--------tokenize.ts(3KB)
--------index.ts(24B)
--------json.ts(144B)
--------recurse.ts(225B)
--------calc.ts(1KB)
--------parse.ts(2KB)
----.npmignore(104B)
----tsconfig.json(6KB)
----LICENSE(1KB)
----test()
--------index.ts(1KB)
----.prettierrc(29B)
----README.md(4KB)
----renovate.json(26B)
----.gitignore(30B)
----package.json(338B)