diff --git a/wasm/demo/node/src/main.ts b/wasm/demo/node/src/main.ts index c4a1c39..124d5d1 100644 --- a/wasm/demo/node/src/main.ts +++ b/wasm/demo/node/src/main.ts @@ -1,7 +1,7 @@ import { Dater } from "cesride-wasm"; function main() { - const date = Dater.new_with_dts("2020-08-22T17:50:09.988921+00:00"); + const date = new Dater("2020-08-22T17:50:09.988921+00:00", undefined, undefined, undefined, undefined, undefined); console.log("
Date:
"); console.log("dts: " + date.dts + "Date:
"); document.write("")
document.write("dts: " + dater.dts + "
");
@@ -57,7 +57,7 @@
document.write("qb64b: " + dater.qb64b + "
");
document.write("qb2: " + dater.qb2 + "
");
try {
- dater = Dater.new_with_dts(dts = "asdf");
+ dater = new Dater("asdf", undefined, undefined, undefined, undefined, undefined);
document.write("Wrong dater: " + dater.dts + "
");
} catch (error) {
document.write("Error: " + error + "
");
diff --git a/wasm/demo/webpack/index.js b/wasm/demo/webpack/index.js
index 4c30dd3..a655358 100644
--- a/wasm/demo/webpack/index.js
+++ b/wasm/demo/webpack/index.js
@@ -13,7 +13,7 @@ document.write(`
`)
let dts = "2020-08-22T17:50:09.988921+00:00";
-let dater = cesride.Dater.new_with_dts(dts);
+let dater = new cesride.Dater(dts, undefined, undefined, undefined, undefined, undefined);
const icp = {
"v": "KERI10JSON00015a_",
@@ -51,7 +51,7 @@ document.write("qb64: " + dater.qb64() + "
");
document.write("qb64b: " + dater.qb64b() + "
");
document.write("qb2: " + dater.qb2() + "
");
try {
- dater = cesride.Dater.new_with_dts(dts = "asdf");
+ dater = new cesride.Dater("asdf", undefined, undefined, undefined, undefined, undefined);
document.write("Wrong dater: " + dater.dts() + "
");
} catch (error) {
document.write("Error: " + error + "
");
diff --git a/wasm/src/primitives/dater.rs b/wasm/src/primitives/dater.rs
index 94e2970..eddcb28 100644
--- a/wasm/src/primitives/dater.rs
+++ b/wasm/src/primitives/dater.rs
@@ -31,31 +31,6 @@ impl DaterWrapper {
Ok(DaterWrapper(dater))
}
- pub fn new_with_dts(dts: &str, code: Option) -> Result {
- let dater = Dater::new_with_dts(dts, code.as_deref()).as_js()?;
- Ok(DaterWrapper(dater))
- }
-
- pub fn new_with_raw(raw: &[u8], code: Option) -> Result {
- let dater = Dater::new_with_raw(raw, code.as_deref()).as_js()?;
- Ok(DaterWrapper(dater))
- }
-
- pub fn new_with_qb64b(qb64b: &[u8]) -> Result {
- let dater = Dater::new_with_qb64b(qb64b).as_js()?;
- Ok(DaterWrapper(dater))
- }
-
- pub fn new_with_qb64(qb64: &str) -> Result {
- let dater = Dater::new_with_qb64(qb64).as_js()?;
- Ok(DaterWrapper(dater))
- }
-
- pub fn new_with_qb2(qb2: &[u8]) -> Result {
- let dater = Dater::new_with_qb2(qb2).as_js()?;
- Ok(DaterWrapper(dater))
- }
-
#[wasm_bindgen(getter)]
pub fn dts(&self) -> Result {
self.0.dts().as_js().map_err(JsValue::from)