mabasic / phel-json
将Phel数据结构转换为JSON格式,以及从JSON格式转换回Phel数据结构的库。
0.5.0
2022-06-11 18:30 UTC
Requires
- phel-lang/phel-lang: ^0.7
README
将Phel数据结构转换为JSON格式,以及从JSON格式转换回Phel数据结构的Phel库。
概述
此Phel库是PHP的json_encode
和json_decode
函数的包装库。
在调用(php/json_encode)
之前,它将Phel数据结构和基本类型转换为PHP理解的形式。
它使用(php/json_decode)
从给定的JSON字符串生成有效的Phel数据结构(map, vector)。
安装
从命令行
composer require mabasic/phel-json
用法
此Phel库有两个公开的方法
(json/encode value {:depth 512 :flags 0})
(json/decode json {:depth 512 :flags 0})
(ns your\namespace
(:require mabasic\json\json))
(def result (json/encode {:name "Phel" :type "lisp"}))
# result
# {"name": "Phel", "type": "lisp"}
(println (json/decode result))
# output
# {:name "Phel" :type "Lisp"}
对于开发者
composer install
composer test
赞助商与支持者
我想向以下赞助商和支持者表示感谢,他们为我资助了开源之旅。如果您有兴趣成为赞助商或支持者,请访问支持者页面。
贡献
感谢您考虑为Phel-json做出贡献!贡献指南可以在这里找到。
行为准则
为了确保开源社区对所有人都友好,请查阅并遵守行为准则。
许可
Phel-json是开源软件,许可协议为MIT许可。