mirror of
https://github.com/TxtDot/dalet.git
synced 2024-12-25 20:23:44 +03:00
fix: daletl body spec and types
This commit is contained in:
parent
bac4c25681
commit
1626ef38eb
6 changed files with 9 additions and 9 deletions
2
libs/rust/Cargo.lock
generated
2
libs/rust/Cargo.lock
generated
|
@ -4,7 +4,7 @@ version = 3
|
|||
|
||||
[[package]]
|
||||
name = "dalet"
|
||||
version = "1.0.0-pre1"
|
||||
version = "1.0.0-pre2"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "dalet"
|
||||
version = "1.0.0-pre1"
|
||||
version = "1.0.0-pre2"
|
||||
edition = "2021"
|
||||
authors = ["artegoser"]
|
||||
license = "MIT"
|
||||
|
|
|
@ -16,7 +16,7 @@ impl Tag {
|
|||
#[derive(Debug)]
|
||||
pub enum Body {
|
||||
Text(String),
|
||||
Tag(Box<Tag>),
|
||||
Tags(Vec<Tag>),
|
||||
Null,
|
||||
}
|
||||
|
||||
|
@ -27,8 +27,8 @@ impl Serialize for Body {
|
|||
{
|
||||
match *self {
|
||||
Body::Text(ref text) => serializer.serialize_str(text),
|
||||
Body::Tag(ref tag) => tag.serialize(serializer),
|
||||
Body::Null => serializer.serialize_str("null"),
|
||||
Body::Tags(ref tag) => tag.serialize(serializer),
|
||||
Body::Null => serializer.serialize_none(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ impl Serialize for Argument {
|
|||
match *self {
|
||||
Argument::Text(ref text) => serializer.serialize_str(text),
|
||||
Argument::Number(number) => serializer.serialize_i8(number),
|
||||
Argument::Null => serializer.serialize_str("null"),
|
||||
Argument::Null => serializer.serialize_none(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@txtdot/dalet",
|
||||
"version": "1.0.0-pre0",
|
||||
"version": "1.0.0-pre1",
|
||||
"description": "Dalet implementation in typescript",
|
||||
"main": "dist/lib.js",
|
||||
"types": "dist/lib.d.ts",
|
||||
|
|
|
@ -3,7 +3,7 @@ import { bodyToRaw } from "../utils";
|
|||
|
||||
export type Root = Tag[];
|
||||
export type Argument = string | number | null;
|
||||
export type Body = Tag[] | null;
|
||||
export type Body = string | Tag[] | null;
|
||||
|
||||
export interface Tag {
|
||||
id: number;
|
||||
|
|
|
@ -21,7 +21,7 @@ All tags specification is in [Tags](./tags.md).
|
|||
```typescript
|
||||
interface Tag {
|
||||
id: number;
|
||||
body: Tag[] | null;
|
||||
body: string | Tag[] | null;
|
||||
argument: string | number | null;
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Reference in a new issue