diff --git a/duper-js-wasm/examples/vite/index.html b/duper-js-wasm/examples/vite/index.html index aca1996..be68bf7 100644 --- a/duper-js-wasm/examples/vite/index.html +++ b/duper-js-wasm/examples/vite/index.html @@ -6,8 +6,7 @@
diff --git a/duper-js-wasm/rollup.config.ts b/duper-js-wasm/rollup.config.js similarity index 77% rename from duper-js-wasm/rollup.config.ts rename to duper-js-wasm/rollup.config.js index 3461868..c5f88ec 100644 --- a/duper-js-wasm/rollup.config.ts +++ b/duper-js-wasm/rollup.config.js @@ -9,5 +9,5 @@ export default { format: "esm", sourcemap: true, }, - plugins: [typescript(), wasm(), terser()], + plugins: [typescript(), wasm({ maxFileSize: 100_000_000 }), terser()], }; diff --git a/duper_website/docs/guide-javascript.md b/duper_website/docs/guide-javascript.md index c5d41fe..505fd96 100644 --- a/duper_website/docs/guide-javascript.md +++ b/duper_website/docs/guide-javascript.md @@ -76,7 +76,7 @@ const input = ` }, image_thumbnail: Png(b64"iVBORw0KGgoAAAANSUhEUgAAAGQ="), tags: ["electronics", "audio", "wireless"], - release_date: Date("2023-11-15"), + release_date: PlainDate('2023-11-15'), /* Warranty is optional */ warranty_period: null, customer_ratings: { @@ -89,20 +89,20 @@ const input = ` `; const duper = parse(input); console.log(duper.identifier); // Product -console.log(duper.inner.in_stock.type); // boolean +console.log(duper.value.in_stock.type); // boolean // Convert to JSON console.log(JSON.stringify(duper)); // Patch the Duper value and pretty-print it -const newTags = [ - new DuperValue("music"), - new DuperValue("hi-fi", "DeprecatedTag", "string"), -]; -duper.inner.tags.setValue(newTags, "tuple"); -duper.inner.image_thumbnail.identifier = null; -duper.inner.weight.identifier = "Pounds"; -delete duper.inner.dimensions; -duper.inner.test = new DuperValue({ foo: new DuperValue("bar") }); +const newTags = DuperValue.Tuple([ + DuperValue.String("music"), + DuperValue.String("hi-fi", "DeprecatedTag"), +]); +duper.value.tags = newTags; +duper.value.image_thumbnail.identifier = null; +duper.value.weight.identifier = "Pounds"; +delete duper.value.dimensions; +duper.value.test = DuperValue.Object({ foo: DuperValue.String("bar") }); console.log(stringify(duper, { indent: " " })); ``` diff --git a/duper_website/docs/intro-to-duper.md b/duper_website/docs/intro-to-duper.md index 3de817c..004060a 100644 --- a/duper_website/docs/intro-to-duper.md +++ b/duper_website/docs/intro-to-duper.md @@ -83,7 +83,7 @@ We can get rid of the quotes for simple keys, use trailing commas, and include c }, image_thumbnail: b64"iVBORw0KGgoAAAANSUhEUgAAAGQ=", tags: ["electronics", "audio", "wireless"], - release_date: "2023-11-15", + release_date: '2023-11-15', /* Warranty is optional */ warranty_period: null, customer_ratings: { @@ -115,7 +115,7 @@ Product({ }, image_thumbnail: Png(b64"iVBORw0KGgoAAAANSUhEUgAAAGQ="), tags: ["electronics", "audio", "wireless"], - release_date: Date("2023-11-15"), + release_date: PlainDate('2023-11-15'), /* Warranty is optional */ warranty_period: null, customer_ratings: {