nuxed / json

Nuxed Json

维护者

详细信息

github.com/nuxed/json

源代码

问题

安装: 661

依赖: 3

建议者: 0

安全性: 0

星标: 1

关注者: 3

分支: 0

公开问题: 0

语言: Hack

v2.0.1 2020-11-22 16:12 UTC

This package is auto-updated.

Last update: 2024-09-23 00:28:44 UTC


README

Coding standards status Static analysis status Unit tests status Total Downloads Latest Stable Version License

Nuxed Json

Nuxed Json 组件提供帮助您安全地编码和解码 json 结构的功能。

安装

此软件包可以通过 Composer 安装。

$ composer require nuxed/json

示例

use namespace Nuxed\Json;
use namespace Facebook\TypeSpec;

<<__EntryPoint>>
async function main(): Awaitable<void> {
  $data = Json\encode(dict[
    'foo' => 5,
    'bar' => 6
  ]);

  // using reified generics.
  $decoded = Json\typed<dict<string, int>>($data);

  // using type spec.
  $decoded = Json\spec($data, TypeSpec\dict(
    TypeSpec\string(), TypeSpec\int();
  ));
}

安全性

有关在 Nuxed 中报告安全漏洞的信息,请参阅 SECURITY.md

许可证

Nuxed 是 MIT 许可下开源的软件。