aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaiwu <kaiwu2004@gmail.com>2024-07-20 22:14:09 +0800
committerkaiwu <kaiwu2004@gmail.com>2024-07-20 22:14:09 +0800
commit3e254a46b7c42e71ecda4233f8b4fbe3de63cc6a (patch)
treecd1f71ae99ad0ec1918f9aa91dd731b57d10c53d
parent1a5cce63cffef4b2c28863a791599fd8df7e70f1 (diff)
downloadwechat-3e254a46b7c42e71ecda4233f8b4fbe3de63cc6a.tar.gz
wechat-3e254a46b7c42e71ecda4233f8b4fbe3de63cc6a.zip
fix version
-rw-r--r--gleam.toml2
-rw-r--r--src/wechat/object.gleam10
2 files changed, 4 insertions, 8 deletions
diff --git a/gleam.toml b/gleam.toml
index 60d78e7..b3e862a 100644
--- a/gleam.toml
+++ b/gleam.toml
@@ -1,5 +1,5 @@
name = "wechat"
-version = "0.1.0"
+version = "1.0.0"
description = "gleam bindings for wechat miniprogram"
target = "javascript"
diff --git a/src/wechat/object.gleam b/src/wechat/object.gleam
index b7ee9d6..66b17c0 100644
--- a/src/wechat/object.gleam
+++ b/src/wechat/object.gleam
@@ -4,9 +4,9 @@
//// # Examples
////
//// ```gleam
-//// > object.literal([#("s", "a string"), #("ss", "another string")])
-//// > |> object.set("i", 42)
-//// > |> object.set("f", fn(i) { i + 1 })
+//// object.literal([#("s", "a string"), #("ss", "another string")])
+//// |> object.set("i", 42)
+//// |> object.set("f", fn(i) { i + 1 })
//// ```
////
//// is exactly like
@@ -100,14 +100,12 @@ pub fn exist(o: JsObject, k: k) -> Bool {
/// # Examples
///
/// ```gleam
-///
/// let f = fn(x) { x + 1 }
/// let b = object.literal([#("a", f)])
/// object.literal([#("b", b)])
/// |> object.paths("b.a")
/// |> result.map(type_of)
/// |> should.equal(Ok(javascript.FunctionType))
-///
/// ```
///
pub fn paths(o: JsObject, path p: String) -> Result(JsObject, WechatError) {
@@ -135,13 +133,11 @@ pub fn get_kv(o: JsObject, key k: String) -> Result(JsObject, WechatError) {
/// # Examples
///
/// ```gleam
-///
/// object.new()
/// |> object.set("a", 1)
/// |> object.get("a")
/// |> result.try(object.int)
/// |> should.equal(Ok(1))
-///
/// ```
///
@external(javascript, "../wechat_ffi.mjs", "obj_set")