Typed Apple binary/XML property lists with bounded decoding and structural editing
moon add Han-Wentao/moonplist@0.1.1let value = @moonplist.decode_xml("<plist><dict><key>name</key><string>demo</string></dict></plist>")
let edited = @moonplist.insert(value, "/version", @moonplist.Integer(2L))
let bytes = @moonplist.encode(edited, @moonplist.Binary)
assert_true(@moonplist.lookup(@moonplist.decode(bytes), "/version") == @moonplist.Integer(2L))| 类型/能力 | binary | XML |
|---|---|---|
| bool、signed64 / unsigned64 整数 | 支持 | 支持 |
| IEEE real(含非有限值、负零) | 读32/64,写64 | 支持;NaN payload 不保留 |
| Unicode / Data / 有序字典 / 数组 | 支持 | 支持 |
| UTC 日期 | 有限 Double 秒,含小数 | 年1–9999、整秒 UTC;小数秒拒绝 |
| Null / UID64 | 支持 | 显式 Unsupported |
| UTF-8 / UTF-16 XML | 不适用 | 字节入口支持 BOM/常见 UTF-16 起始模式 |
moon info
moon fmt --check
moon check --target wasm-gc --deny-warn
moon test --target wasm-gc --deny-warn
moon test --target js --deny-warn
moon run examples/workflows --target js
python scripts/differential.pypub(all) suberror PlistError {
Invalid(String)
Limit(String)
Unsupported(String)
PathError(String)
}pub(all) struct BinaryInfo {
object_count : Int
root_id : Int
offset_table : Int
offset_width : Int
reference_width : Int
}pub(all) struct Limits {
max_bytes : Int
max_objects : Int
max_depth : Int
max_items : Int
}fn encode_base64(data : Bytes) -> Stringfn insert(value : Value, pointer : String, replacement : Value, limits? : Limits) -> Value raise PlistErrorfn replace(value : Value, pointer : String, replacement : Value, limits? : Limits) -> Value raise PlistErrorInstall
Download zipTyped Apple binary/XML property lists with bounded decoding and structural editing